Skip to content

Commit

Permalink
consolidated premint versions
Browse files Browse the repository at this point in the history
  • Loading branch information
oveddan committed Nov 28, 2023
1 parent 7fee962 commit ef7d979
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion packages/protocol-sdk/src/premint/preminter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -220,10 +220,12 @@ export async function isAuthorizedToCreateSignatureLegacy({
premintConfig,
premintConfigVersion,
signature,
signer,
}: {
collection: ContractCreationConfig;
publicClient: PublicClient;
signature: Hex;
signer: Address;
} & PremintConfigAndVersion) {
if (premintConfigVersion === PremintConfigVersion.V1) {
const [isValidSignature] = await publicClient.readContract({
Expand All @@ -236,7 +238,15 @@ export async function isAuthorizedToCreateSignatureLegacy({
return isValidSignature;
}

return isAuthorizedToCreatePremint({});
return isAuthorizedToCreatePremint({
premintConfigContractAdmin: collection.contractAdmin as Address,
collectionAddress: await getPremintCollectionAddress({
publicClient: publicClient,
collection,
}),
publicClient,
signer,
});
}

export async function isAuthorizedToCreatePremint({
Expand Down

0 comments on commit ef7d979

Please sign in to comment.