Releases: ourzora/zora-protocol
@zoralabs/[email protected]
Patch Changes
- e4edaac: fixed bug where premint config v2 did not have correct eip-712 domain. fixed bug in CreatorAttribution event where structHash was not included in it
@zoralabs/[email protected]
Patch Changes
-
97f58b3:
MintAPIClient
is now a class, that takes a chain id and httpClient in the constructor, enabling the httpClient methodsfetch
,post
, andretries
to be overridden.new methods on
MintAPIClient
:getMintableForToken
- takes a token id and token contract address and returns the mintable for it. Easier to use for fetching specific tokens thangetMintable
.MintClient
now takes the optionalPublicClient
in the constructor instead of in each function, and stores it or creates a default one if none is provided in the constructor. It also takes an optionalhttpClient
param in the constructor, allowing thefetch
,post
, andretries
methods to be overridden when using the api. It now internally creates the MintAPIClient.MintClient.makePrepareMintTokenParams
has the following changes:- returns a
SimulateContractParams
, instead of an object containing it indexed by key - no longer takes a
PublicClient
as an argument (it should be specified in the constructor instead)
new function
MintClient.getMintCosts
takes a mintable and quantity to mint and returns the mintFee, paidMintPrice, and totalCost. - returns a
-
d02484e: premintClient can have http methods overridable via DI, and now takes publicClient and http overrides in
createPremintClient
function. it no longer takespublicClient
as an argument in functions, and rather uses them from the constructor.executePremint
has been renamed otmakeMintParameters
@zoralabs/[email protected]
Patch Changes
- 128b05c: Updated determinstic preminter deployment script to not fail if already deployed
- 1d58cd1: Deployed 2.5.2 to zora sepolia and zora goerli
- 128b05c: Deployed 2.5.1 to zora sepolia and zora goerli
- Updated dependencies [e4edaac]
- @zoralabs/[email protected]
@zoralabs/[email protected]
Patch Changes
- 68566fc: Fixed setting uid when doing a premint v1
@zoralabs/[email protected]
Patch Changes
- Updated dependencies [dba9bb0]
- Updated dependencies [4c4ae23]
- @zoralabs/[email protected]
@zoralabs/[email protected]
@zoralabs/[email protected]
Minor Changes
-
d84721a: # Premint v2
New fields on signature
Adding a new
PremintConfigV2
struct that can be signed, that now contains acreateReferral
.ZoraCreator1155PremintExecutor
recognizes new version of the premint config, and still works with the v1 (legacy) version of thePremintConfig
. Version one of the premint config still works and is still defined in thePremintConfig
struct.Additional changes included in
PremintConfigV2
:tokenConfig.royaltyMintSchedule
has been removed as it is deprecated and no longer recognized by new versions of the 1155 contracttokenConfig.royaltyRecipient
has been renamed totokenConfig.payoutRecipient
to better reflect the fact that this address is used to receive creator rewards, secondary royalties, and paid mint funds. This is the address that will be set on theroyaltyRecipient
for the created token on the 1155 contract, which is the address that receives creator rewards and secondary royalties for the token, and on thefundsRecipient
on the ZoraCreatorFixedPriceSaleStrategy contract for the token, which is the address that receives paid mint funds for the token.
New MintArguments on premint functions, specifying
mintRecipient
andmintReferral
mintReferral
andmintRecipient
are now specified in the premint functions on theZoraCreator1155PremintExecutor
, via theMintArguments mintArguments
param; newpremintV1
andpremintV2
functions take aMintArguments
struct as an argument which containsmintRecipient
, defining which account will receive the minted tokens,mintComment
, andmintReferral
, defining which account will receive a mintReferral reward, if any.mintRecipient
must be specified or else it reverts.Replacing external signature validation and authorization check with just authorization check
ZoraCreator1155PremintExecutor
's functionisValidSignature(contractConfig, premintConfig)
is deprecated in favor of:isAuthorizedToCreatePremint( address signer, address premintContractConfigContractAdmin, address contractAddress ) public view returns (bool isAuthorized)
which instead of validating signatures and checking if the signer is authorized to create premints, just checks if an signer is authorized to create premints on the contract. This offloads signature decoding/validation to calling clients offchain, and reduces needing to create different signatures for this function on the contract for each version of the premint config. It also allows Premints to be validated on contracts that were not created using premints, such as contracts that are upgraded, and contracts created directly via the factory.
Changes to handling of setting of fundsRecipient
Previously the
fundsRecipient
on the fixed priced minters' sales config for the token was set to the signer of the premint. This has been changed to be set to thepayoutRecipient
of the premint config onPremintConfigV2
, and to theroyaltyRecipient
of the premint config for v1 of the premint config, for 1155 contracts that are to be newly created, and for existing 1155 contracts that are upgraded to the latest version.Changes to 1155's
delegateSetupNewToken
delegateSetupNewToken
on 1155 contract has been updated to now take an abi encoded premint config, premint config version, and send it to an external library to decode the config, the signer, and setup actions. Previously it took a non-encoded PremintConfig. This new change allows this function signature to support multiple versions of a premint config, while offloading decoding of the config and the corresponding setup actions to the external library. This ultimately allows supporting multiple versions of a premint config and corresponding signature without increasing codespace.PremintConfigV2
are updated to containcreateReferral
, and now look like:struct PremintConfigV2 { // The config for the token to be created TokenCreationConfigV2 tokenConfig; // 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. uint32 uid; // Version of this premint, scoped to the uid and contract. Not used for logic in the contract, but used externally to track the newest version uint32 version; // If executing this signature results in preventing any signature with this uid from being minted. bool deleted; } struct TokenCreationConfigV2 { // Metadata URI for the created token string tokenURI; // Max supply of the created token uint256 maxSupply; // Max tokens that can be minted for an address, 0 if unlimited uint64 maxTokensPerAddress; // Price per token in eth wei. 0 for a free mint. uint96 pricePerToken; // The start time of the mint, 0 for immediate. Prevents signatures from being used until the start time. uint64 mintStart; // The duration of the mint, starting from the first mint of this token. 0 for infinite uint64 mintDuration; // RoyaltyBPS for created tokens. The royalty amount in basis points for secondary sales. uint32 royaltyBPS; // The address that will receive creatorRewards, secondary royalties, and paid mint funds. This is the address that will be set on the `royaltyRecipient` for the created token on the 1155 contract, which is the address that receives creator rewards and secondary royalties for the token, and on the `fundsRecipient` on the ZoraCreatorFixedPriceSaleStrategy contract for the token, which is the address that receives paid mint funds for the token. address payoutRecipient; // Fixed price minter address address fixedPriceMinter; // create referral address createReferral; }
PremintConfig
fields are the same as they were before, but are treated as a version 1:struct PremintConfig { // The config for the token to be created TokenCreationConfig tokenConfig; // 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. uint32 uid; // Version of this premint, scoped to the uid and contract. Not used for logic in the contract, but used externally to track the newest version uint32 version; // If executing this signature results in preventing any signature with this uid from being minted. bool deleted; } struct TokenCreationConfig { // Metadata URI for the created token string tokenURI; // Max supply of the created token uint256 maxSupply; // Max tokens that can be minted for an address, 0 if unlimited uint64 maxTokensPerAddress; // Price per token in eth wei. 0 for a free mint. uint96 pricePerToken; // The start time of the mint, 0 for immediate. Prevents signatures from being used until the start time. uint64 mintStart; // The duration of the mint, starting from the first mint of this token. 0 for infinite uint64 mintDuration; // deperecated field; will be ignored. uint32 royaltyMintSchedule; // RoyaltyBPS for created tokens. The royalty amount in basis points for secondary sales. uint32 royaltyBPS; // The address that will receive creatorRewards, secondary royalties, and paid mint funds. This is the address that will be set on the `royaltyRecipient` for the created token on the 1155 contract, which is the address that receives creator rewards and secondary royalties for the token, and on the `fundsRecipient` on the ZoraCreatorFixedPriceSaleStrategy contract for the token, which is the address that receives paid mint funds for the token. address royaltyRecipient; // Fixed price minter address address fixedPriceMinter; }
Changes to
ZoraCreator1155PremintExecutorImpl
:- new function
premintV1
- takes aPremintConfig
, 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 aPremintConfigV2
signature and executes a premint, with being able to specify mint referral and mint recipient - deprecated function
premint
- callpremintV1
instead - new function
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
- callisAuthorizedToCreatePremint
instead
Patch Changes
- 885ffa4: Premint executor can still execute premint mints that were created with V1 signatures for
delegateSetupNewToken
- ffb5cb7: Premint - added method getSupportedPremintSignatureVersions(contractAddress) that returns an array of the premint signature versions an 1155 contract supports. If the contract hasn't been created yet, assumes that when it will be created it will support the latest versions of the signatures, so the function returns all versions.
- ffb5cb7: Added method
IZoraCreator1155PremintExecutor.supportedPremintSignatureVersions(contractAddress)
that tells what version of the premint signat...
@zoralabs/[email protected]
Patch Changes
- de0b0b7:
preminter
exposes new function isValidSignatureV1 that recovers a signer from a signed premint and determines if that signer is authorized to sign - Updated dependencies [f3b7df8]
- @zoralabs/[email protected]
@zoralabs/[email protected]
@zoralabs/[email protected]
Patch Changes
- 92da3ed: Exporting mint client
- Updated dependencies [293e2c0]
- @zoralabs/[email protected]