Skip to content

Commit

Permalink
fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
oveddan committed Nov 28, 2023
1 parent 7ff9a4b commit ed22deb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 0 additions & 1 deletion packages/protocol-sdk/src/premint/premint-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import {
PremintConfigV2,
PremintConfigVersion,
getPremintCollectionAddress,
isAuthorizedToCreatePremint,
isValidSignature,
premintTypedDataDefinition,
isAuthorizedToCreateSignatureLegacy,
Expand Down
3 changes: 3 additions & 0 deletions packages/protocol-sdk/src/premint/preminter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,8 @@ export async function isAuthorizedToCreateSignatureLegacy({
signature: Hex;
signer: Address;
} & PremintConfigAndVersion) {
// if we are using legacy version of premint config, we can use the function
// "isValidSignature" which we know exists on the premint executor contract
if (premintConfigVersion === PremintConfigVersion.V1) {
const [isValidSignature] = await publicClient.readContract({
abi: zoraCreator1155PremintExecutorImplABI,
Expand All @@ -238,6 +240,7 @@ export async function isAuthorizedToCreateSignatureLegacy({
return isValidSignature;
}

// otherwize, we must assume the newer version of premint executor is deployed, so we call that.
return isAuthorizedToCreatePremint({
premintConfigContractAdmin: collection.contractAdmin as Address,
collectionAddress: await getPremintCollectionAddress({
Expand Down

0 comments on commit ed22deb

Please sign in to comment.