From 80088df10931ae2db29abbc5c48ec13410984413 Mon Sep 17 00:00:00 2001 From: Dan Oved Date: Thu, 9 Nov 2023 16:55:00 -0800 Subject: [PATCH] updated changeset --- .changeset/violet-starfishes-visit.md | 13 +++++++++++-- .changeset/wicked-dolphins-remain.md | 5 +++++ 2 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 .changeset/wicked-dolphins-remain.md diff --git a/.changeset/violet-starfishes-visit.md b/.changeset/violet-starfishes-visit.md index bdd1b3c6c..808aa7a11 100644 --- a/.changeset/violet-starfishes-visit.md +++ b/.changeset/violet-starfishes-visit.md @@ -109,6 +109,15 @@ struct TokenCreationConfig { * new function `premintV1` - takes a `PremintConfig`, and premint v1 signature, and executes a premint, with added functionality of being able to specify mint referral and mint recipient * new function `premintV2` - takes a `PremintConfigV2` signature and executes a premint, with being able to specify mint referral and mint recipient * deprecated function `premint` - call `premintV1` instead -* new function `isValidSignatureV1` - takes an 1155 address, contract admin, premint v1 config and signature, and validates the signature. Can be used for 1155 contracts that were not created via the premint executor contract. -* new function `isValidSignatureV2` - takes an 1155 address, contract admin, premint v2 config and signature, and validates the signature. Can be used for 1155 contracts that were not created via the premint executor contract. +* new function + +```solidity +isAuthorizedToCreatePremint( + address signer, + address premintContractConfigContractAdmin, + address contractAddress +) public view returns (bool isAuthorized) +``` + +takes a signer, contractConfig.contractAdmin, and 1155 address, and determines if the signer is authorized to sign premints on the given contract. Replaces `isValidSignature` - by putting the burden on clients to first decode the signature, then pass the recovered signer to this function to determine if the signer has premint authorization on the contract. * deprecated function `isValidSignature` - call `isValidSignatureV1` instead diff --git a/.changeset/wicked-dolphins-remain.md b/.changeset/wicked-dolphins-remain.md new file mode 100644 index 000000000..d62c0c26c --- /dev/null +++ b/.changeset/wicked-dolphins-remain.md @@ -0,0 +1,5 @@ +--- +"@zoralabs/premint-sdk": patch +--- + +`preminter` exposes new function isValidSignatureV1 that recovers a signer from a signed premint and determines if that signer is authorized to sign