Skip to content

Commit

Permalink
Added platform referral field, which is not currently supported but i…
Browse files Browse the repository at this point in the history
…s in the sig
  • Loading branch information
oveddan committed Nov 9, 2023
1 parent 6cd9aeb commit 4ad4e1c
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ struct TokenCreationConfigV2 {
address fixedPriceMinter;
// create referral
address createReferral;
// platform referral
address platformReferral;
}

library ZoraCreator1155Attribution {
Expand Down Expand Up @@ -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) {
Expand All @@ -218,7 +220,8 @@ library ZoraCreator1155Attribution {
tokenConfig.royaltyBPS,
tokenConfig.payoutRecipient,
tokenConfig.fixedPriceMinter,
tokenConfig.createReferral
tokenConfig.createReferral,
tokenConfig.platformReferral
)
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ library Zora1155PremintFixtures {
fixedPriceMinter: address(fixedPriceMinter),
payoutRecipient: royaltyRecipient,
royaltyBPS: 0,
createReferral: address(0)
createReferral: address(0),
platformReferral: address(0)
});
}

Expand All @@ -48,7 +49,8 @@ library Zora1155PremintFixtures {
fixedPriceMinter: address(fixedPriceMinter),
payoutRecipient: royaltyRecipient,
royaltyBPS: 10,
createReferral: createReferral
createReferral: createReferral,
platformReferral: address(0)
});
}

Expand Down
4 changes: 3 additions & 1 deletion packages/1155-contracts/test/nft/ZoraCreator1155.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 4ad4e1c

Please sign in to comment.