From 4ad4e1cb6ecba834ef68e1b36391dc5a55c99422 Mon Sep 17 00:00:00 2001 From: Dan Oved Date: Wed, 8 Nov 2023 16:22:54 -0800 Subject: [PATCH] Added platform referral field, which is not currently supported but is in the sig --- .../src/delegation/ZoraCreator1155Attribution.sol | 7 +++++-- .../test/fixtures/Zora1155PremintFixtures.sol | 6 ++++-- packages/1155-contracts/test/nft/ZoraCreator1155.t.sol | 4 +++- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/packages/1155-contracts/src/delegation/ZoraCreator1155Attribution.sol b/packages/1155-contracts/src/delegation/ZoraCreator1155Attribution.sol index 6f24664b7..aba31ea61 100644 --- a/packages/1155-contracts/src/delegation/ZoraCreator1155Attribution.sol +++ b/packages/1155-contracts/src/delegation/ZoraCreator1155Attribution.sol @@ -91,6 +91,8 @@ struct TokenCreationConfigV2 { address fixedPriceMinter; // create referral address createReferral; + // platform referral + address platformReferral; } library ZoraCreator1155Attribution { @@ -201,7 +203,7 @@ library ZoraCreator1155Attribution { bytes32 constant TOKEN_DOMAIN_V2 = keccak256( - "TokenCreationConfig(string tokenURI,uint256 maxSupply,uint64 maxTokensPerAddress,uint96 pricePerToken,uint64 mintStart,uint64 mintDuration,uint32 royaltyBPS,address payoutRecipient,address fixedPriceMinter,address createReferral)" + "TokenCreationConfig(string tokenURI,uint256 maxSupply,uint64 maxTokensPerAddress,uint96 pricePerToken,uint64 mintStart,uint64 mintDuration,uint32 royaltyBPS,address payoutRecipient,address fixedPriceMinter,address createReferral,address platformReferral)" ); function _hashToken(TokenCreationConfigV2 memory tokenConfig) private pure returns (bytes32) { @@ -218,7 +220,8 @@ library ZoraCreator1155Attribution { tokenConfig.royaltyBPS, tokenConfig.payoutRecipient, tokenConfig.fixedPriceMinter, - tokenConfig.createReferral + tokenConfig.createReferral, + tokenConfig.platformReferral ) ); } diff --git a/packages/1155-contracts/test/fixtures/Zora1155PremintFixtures.sol b/packages/1155-contracts/test/fixtures/Zora1155PremintFixtures.sol index e3d99241f..c537616e6 100644 --- a/packages/1155-contracts/test/fixtures/Zora1155PremintFixtures.sol +++ b/packages/1155-contracts/test/fixtures/Zora1155PremintFixtures.sol @@ -28,7 +28,8 @@ library Zora1155PremintFixtures { fixedPriceMinter: address(fixedPriceMinter), payoutRecipient: royaltyRecipient, royaltyBPS: 0, - createReferral: address(0) + createReferral: address(0), + platformReferral: address(0) }); } @@ -48,7 +49,8 @@ library Zora1155PremintFixtures { fixedPriceMinter: address(fixedPriceMinter), payoutRecipient: royaltyRecipient, royaltyBPS: 10, - createReferral: createReferral + createReferral: createReferral, + platformReferral: address(0) }); } diff --git a/packages/1155-contracts/test/nft/ZoraCreator1155.t.sol b/packages/1155-contracts/test/nft/ZoraCreator1155.t.sol index 55ba19ba2..e4e917cb3 100644 --- a/packages/1155-contracts/test/nft/ZoraCreator1155.t.sol +++ b/packages/1155-contracts/test/nft/ZoraCreator1155.t.sol @@ -1068,7 +1068,9 @@ contract ZoraCreator1155Test is Test { // Fixed price minter address fixedPriceMinter: address(fixedPriceMinter), // Default create referral - createReferral: address(0) + createReferral: address(0), + // Default platform referral + platformReferral: address(0) }), // Unique id of the token, used to ensure that multiple signatures can't be used to create the same intended token. // only one signature per token id, scoped to the contract hash can be executed.