Skip to content

Commit

Permalink
undo changes to premint
Browse files Browse the repository at this point in the history
  • Loading branch information
oveddan committed Nov 24, 2023
1 parent cc652d1 commit b6ceccf
Showing 1 changed file with 12 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,6 @@ struct PremintConfigV2 {
bool deleted;
}

struct PremintSettings {
uint32 uid;
uint32 version;
bool deleted;
}

struct TokenCreationConfigV2 {
// Metadata URI for the created token
string tokenURI;
Expand Down Expand Up @@ -162,17 +156,23 @@ library ZoraCreator1155Attribution {
"CreatorAttribution(TokenCreationConfig tokenConfig,uint32 uid,uint32 version,bool deleted)TokenCreationConfig(string tokenURI,uint256 maxSupply,uint64 maxTokensPerAddress,uint96 pricePerToken,uint64 mintStart,uint64 mintDuration,uint32 royaltyMintSchedule,uint32 royaltyBPS,address royaltyRecipient,address fixedPriceMinter)"
);

function hashPremint(TokenCreationConfig memory tokenConfig, PremintSettings memory settings) internal pure returns (bytes32) {
return keccak256(abi.encode(ATTRIBUTION_DOMAIN_V1, _hashToken(tokenConfig), settings.uid, settings.version, settings.deleted));
function hashPremint(PremintConfig memory premintConfig) internal pure returns (bytes32) {
return
keccak256(
abi.encode(ATTRIBUTION_DOMAIN_V1, _hashToken(premintConfig.tokenConfig), premintConfig.uid, premintConfig.version, premintConfig.deleted)
);
}

bytes32 constant ATTRIBUTION_DOMAIN_V2 =
keccak256(
"CreatorAttribution(TokenCreationConfig tokenConfig,uint32 uid,uint32 version,bool deleted)TokenCreationConfig(string tokenURI,uint256 maxSupply,uint64 maxTokensPerAddress,uint96 pricePerToken,uint64 mintStart,uint64 mintDuration,uint32 royaltyBPS,address payoutRecipient,address fixedPriceMinter,address createReferral)"
);

function hashPremint(TokenCreationConfigV2 memory tokenConfig, PremintSettings memory settings) internal pure returns (bytes32) {
return keccak256(abi.encode(ATTRIBUTION_DOMAIN_V2, _hashToken(tokenConfig), settings.uid, settings.version, settings.deleted));
function hashPremint(PremintConfigV2 memory premintConfig) internal pure returns (bytes32) {
return
keccak256(
abi.encode(ATTRIBUTION_DOMAIN_V2, _hashToken(premintConfig.tokenConfig), premintConfig.uid, premintConfig.version, premintConfig.deleted)
);
}

bytes32 constant TOKEN_DOMAIN_V1 =
Expand Down Expand Up @@ -392,10 +392,7 @@ library DelegatedTokenCreation {

creatorAttribution = recoverCreatorAttribution(
ZoraCreator1155Attribution.VERSION_1,
ZoraCreator1155Attribution.hashPremint(
premintConfig.tokenConfig,
PremintSettings({uid: premintConfig.uid, version: premintConfig.version, deleted: premintConfig.deleted})
),
ZoraCreator1155Attribution.hashPremint(premintConfig),
tokenContract,
signature
);
Expand All @@ -406,10 +403,7 @@ library DelegatedTokenCreation {

creatorAttribution = recoverCreatorAttribution(
ZoraCreator1155Attribution.VERSION_2,
ZoraCreator1155Attribution.hashPremint(
premintConfig.tokenConfig,
PremintSettings({uid: premintConfig.uid, version: premintConfig.version, deleted: premintConfig.deleted})
),
ZoraCreator1155Attribution.hashPremint(premintConfig),
tokenContract,
signature
);
Expand Down

0 comments on commit b6ceccf

Please sign in to comment.