diff --git a/docs/package.json b/docs/package.json index 8109a597..64aaa817 100644 --- a/docs/package.json +++ b/docs/package.json @@ -7,7 +7,8 @@ "dev": "vocs dev", "build": "tsc --noEmit", "build:site": "vocs build", - "preview": "vocs preview" + "preview": "vocs preview", + "copy-changelog": "pnpm tsx scripts/copy-changelogs.ts" }, "dependencies": { "@0xsplits/splits-sdk": "^4.0.2", diff --git a/docs/pages/changelogs/1155-contracts.mdx b/docs/pages/changelogs/1155-contracts.mdx new file mode 100644 index 00000000..b1238fa5 --- /dev/null +++ b/docs/pages/changelogs/1155-contracts.mdx @@ -0,0 +1,667 @@ +# Zora 1155 Contracts Changelog + + +## 2.12.4 + +### Patch Changes + +- [82f63033](https://github.com/ourzora/zora-protocol/commit/82f63033): Remove unused canMintQuantity modifier from 1155 contracts + +## 2.12.3 + +### Patch Changes + +- [2fce20f4](https://github.com/ourzora/zora-protocol/commit/2fce20f4): Adding a new getOrCreateFactory function for the 1155 contracts. + +## 2.12.2 + +### Patch Changes + +- [cf108bdb](https://github.com/ourzora/zora-protocol/commit/cf108bdb): 1155 mint fee hardcoded to 0.000777 eth + +## 2.12.1 + +### Patch Changes + +- [527aa518](https://github.com/ourzora/zora-protocol/commit/527aa518): Move from yarn to pnpm properly pinning deps packages. + +## 2.12.0 + +### Minor Changes + +- [0ec838a4](https://github.com/ourzora/zora-protocol/commit/0ec838a4): 1155 contracts have a hardcoded mint fee of 0.000111 ether, and no longer have a fee that is determined by the MintsManager contract + +### Patch Changes + +- [898c84a7](https://github.com/ourzora/zora-protocol/commit/898c84a7): [chore] Update dependencies and runtime scripts + + This ensures jobs do not match binary names to make runs less ambigious and also that all deps are accounted for. + +- [2677c896](https://github.com/ourzora/zora-protocol/commit/2677c896): Add reduceSupply interface check to 1155 + +## 2.11.0 + +### Minor Changes + +- [d460e79c](https://github.com/ourzora/zora-protocol/commit/d460e79c): - Introduced a `reduceSupply` function allowing an approved minter or admin to reduce the supply for a given token id. New supply must be less than the current maxSupply, and greater than or equal to the total minted so far. + - Removed the deprecated `mintWithRewards` function + +## 2.10.1 + +### Patch Changes + +- [368940ba](https://github.com/ourzora/zora-protocol/commit/368940ba): Change removePermission behavior to allow a user to remove their own permission + +## 2.10.0 + +### Minor Changes + +- [43a394ab](https://github.com/ourzora/zora-protocol/commit/43a394ab): `ERC20PremintConfig` replaced by a more general purpose `PremintConfigV3`, which instead of having erc20 premint specific properties, as an abi encoded `premintSalesConfig`, that is passed to the function `setPremintSale` on the corresponding minter contract. + + The new `TokenCreationConfigV3` looks like: + + ```solidity + struct TokenCreationConfigV3 { + // Metadata URI for the created token + string tokenURI; + // Max supply of the created token + uint256 maxSupply; + // RoyaltyBPS for created tokens. The royalty amount in basis points for secondary sales. + uint32 royaltyBPS; + // The address that the will receive rewards/funds/royalties. + address payoutRecipient; + // The address that referred the creation of the token. + address createReferral; + // The start time of the mint, 0 for immediate. + uint64 mintStart; + // The address of the minter module. + address minter; + // The abi encoded data to be passed to the minter to setup the sales config for the premint. + bytes premintSalesConfig; + } + ``` + + where the `premintSalesConfig` is an abi encoded struct that is passed to the minter's function `setPremintSale`: + + ```solidity + ERC20Minter.PremintSalesConfig memory premintSalesConfig = ERC20Minter.PremintSalesConfig({ + currency: address(mockErc20), + pricePerToken: 1e18, + maxTokensPerAddress: 5000, + duration: 1000, + payoutRecipient: collector + }); + + + // this would be set as the property `premintSalesConfig` in the `TokenCreationConfigV3` + bytes memory encodedPremintSalesConfig = abi.encode(premintSalesConfig); + ``` + + Correspondingly, new minters must implement the new interface `ISetPremintSale` to be compatible with the new `TokenCreationConfigV3`: + + ```solidity + interface ISetPremintSale { + function setPremintSale(uint256 tokenId, bytes calldata salesConfig) external; + } + + // example implementation: + contract ERC20Minter is ISetPremintSale { + struct PremintSalesConfig { + address currency; + uint256 pricePerToken; + uint64 maxTokensPerAddress; + uint64 duration; + address payoutRecipient; + } + + function buildSalesConfigForPremint( + PremintSalesConfig memory config + ) public view returns (ERC20Minter.SalesConfig memory) { + uint64 saleStart = uint64(block.timestamp); + uint64 saleEnd = config.duration == 0 + ? type(uint64).max + : saleStart + config.duration; + + return + IERC20Minter.SalesConfig({ + saleStart: saleStart, + saleEnd: saleEnd, + maxTokensPerAddress: config.maxTokensPerAddress, + pricePerToken: config.pricePerToken, + fundsRecipient: config.payoutRecipient, + currency: config.currency + }); + } + + function toSaleConfig( + bytes calldata encodedPremintSalesConfig + ) private returns (IERC20Minter.SalesConfig memory) { + PremintSalesConfig memory premintSalesConfig = abi.decode( + encodedPremintSalesConfig, + (PremintSalesConfig) + ); + + return buildSalesConfigForPremint(premintSalesConfig); + } + + mapping(address => mapping(uint256 => IERC20Minter.SalesConfig)) public sale; + + function setPremintSale( + uint256 tokenId, + bytes calldata premintSalesConfig + ) external override { + IERC20Minter.SalesConfig memory salesConfig = toSaleConfig( + premintSalesConfig + ); + + sale[msg.sender][tokenId] = salesConfig; + } + } + ``` + +- [2475a4c9](https://github.com/ourzora/zora-protocol/commit/2475a4c9): Updates to Premint that enables preminting against contracts that were not created via premint, as well as adding collaborators to premint contracts by being able specify an array of additionalAdmins in a premint's contract creation config. + + #### No breaking changes + + These updates are fully backwards compatible; the old functions on the contracts are still intact and will work. Additionally, these updates dont require a new premint config version to be signed; the only thing that could be affected is the deterministic address to be signed against, in the case there are additional contract admins. + + #### Ability to add contract-wide additional admins with premint + + There is a new struct called `ContractWithAdditionalAdminsCreationConfig` that replaces `ContractCreationConfig`. This contains, in addition to the existing fields, a new array `address[] additionalAdmins` - these addresses are added as additional admins when a contract is created by converting each address into a setup action that adds the contract-wide role `PERMISSION_BIT_ADMIN` to that account. + + ```solidity + // new struct: + struct ContractWithAdditionalAdminsCreationConfig { + // Creator/admin of the created contract. Must match the account that signed the message + address contractAdmin; + // Metadata URI for the created contract + string contractURI; + // Name of the created contract + string contractName; + // additional accounts that will be added as admins + // to the contract + address[] additionalAdmins; + } + + // existing struct that is replaced: + struct ContractCreationConfig { + address contractAdmin; + string contractURI; + string contractName; + } + ``` + + Having a list of `additionalAdmins` results in the 1155 contract having a different deterministic address, based on a `salt` made from a hash of the array of `setupActions` that are generated to add those additional accounts as admins. As a result, the creator and additional admins would be signing a message against an address expected to be deterministic with consideration for those additional admins. + + To get the address in consideration of the new admins, there is a new function on the preminter contract: + + ```solidity + // new function that takes into consideration the additional admins: + function getContractWithAdditionalAdminsAddress( + ContractWithAdditionalAdminsCreationConfig calldata contractConfig + ) public view override returns (address); + + // existing function can be called if there are no additional admins: + function getContractAddress( + ContractCreationConfig calldata contractConfig + ) public view override returns (address); + ``` + + This should be called to get the expected contract address when there are additional admins. + + To determine if an address is authorized to create a premint when there are additional admins, there is a new function: + + ```solidity + // new function that takes into consideration the additional admins: + function isAuthorizedToCreatePremintWithAdditionalAdmins( + address signer, + address premintContractConfigContractAdmin, + address contractAddress, + address[] calldata additionalAdmins + ) public view returns (bool isAuthorized); + + // existing function can be called if there are no additional admins: + function isAuthorizedToCreatePremint( + address signer, + address premintContractConfigContractAdmin, + address contractAddress + ) public view returns (bool isAuthorized); + ``` + + If any account in those `additionalAdmins`, it is considered authorized and can also sign a premint against the contract address of the original premint, before the contract is created. The collaborator's premint can be brought onchain first, and the original admin will be set as the admin along with all the `additionalAdmins`. + + #### New ability to do premints against existing contracts + + Executing premint against contracts not created via premint can be done with by passing a `premintCollection` argument to the new `premint` function: + + ```solidity + function premint( + ContractWithAdditionalAdminsCreationConfig memory contractConfig, + address premintCollection, + PremintConfigEncoded calldata encodedPremintConfig, + bytes calldata signature, + uint256 quantityToMint, + MintArguments calldata mintArguments, + address firstMinter, + address signerContract + ) external payable returns (uint256 tokenId); + ``` + + This premint collection's address must be a zora creator 1155 contract that already supports premint, which is version 2.0.0 and up. + + #### New single shared function for executing a premint, which works with all versions of premint configs + + In order to avoid having to create one function each for premint v1, v2, and future versions of premint, the new function `premint` takes a struct `PremintConfigEncoded` that contains common properties for premint: `uid`, `version`, and `deleted`, an abi encoded `tokenConfig` and a `premintConfigVersion`; the abi encoded token config can be a `TokenCreationConfigV1`, `TokenCreationConfigV2`, or `TokenCreationConfigV3`. + + Correspondingly the existing `premintV1/premintV2/premintERC20` functions are deprecated in favor of this new function `premint` that takes a `PremintConfigEncoded` for the premintConfig, and the `contractCreationConfig` as the first argument. If the `premintCollection` parameter is set to a zeroAddress, the function will get or create a contract with an address determined by the contractCreationConfig. This single function works with all versions of premint configs: + + ```solidity + struct PremintConfigEncoded { + // 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; + // abi encoded token creation config + bytes tokenConfig; + // hashed premint config version + bytes32 premintConfigVersion; + } + + function premint( + ContractWithAdditionalAdminsCreationConfig memory contractConfig, + address premintCollection, + PremintConfigEncoded calldata encodedPremintConfig, + bytes calldata signature, + uint256 quantityToMint, + MintArguments calldata mintArguments, + address firstMinter, + address signerContract + ) external payable returns (uint256 tokenId); + ``` + + `premintV2WithSignerContract` has been removed from the preminter contract to save contract size. + + #### 1155 factory's createContractDeterministic resulting address is affected by `setupActions` + + The FactoryProxy's `createContractDeterministic` function now takes into consideration the `bytes[] calldata setupActions` when creating the contract at the deterministic address. This won't affect contracts that don't have any setup actions, as their address will be the same as it was before. + +## 2.9.1 + +### Patch Changes + +- [cd6c6361](https://github.com/ourzora/zora-protocol/commit/cd6c6361): ERC20 Minter V2 Changes: + - Adds a flat ETH fee that goes to Zora (currently this fee is 0.000111 ETH but the contract owner can change this fee at any time) + - Reward recipients will still receive ERC20 rewards however this percentage can now be changed at any time by the contract owner + - Adds an `ERC20MinterConfig` struct which contains `zoraRewardRecipientAddress`, `rewardRecipientPercentage`, and `ethReward` + - Zora Reward Recipient Address can now be changed at any time by the contract owner as well + - `mint` function is now payable + - New functions: + - `function ethRewardAmount() external view returns (uint256)` + - `function setERC20MinterConfig(ERC20MinterConfig memory config) external` + - `function getERC20MinterConfig() external view returns (ERC20MinterConfig memory)` + - New events: + - `event ERC20MinterConfigSet(ERC20MinterConfig config)` + - Removed events: + - `event ZoraRewardsRecipientSet(address indexed prevRecipient, address indexed newRecipient)` + - `event ERC20MinterInitialized(uint256 rewardPercentage)` + +## 2.9.0 + +### Minor Changes + +- 50a4e09: + - Zora Creator 1155 contracts use the MINTs contracts to get the mint fee, mint, and redeem a mint ticket upon minting. + - `ZoraCreator1155Impl` adds a new method `mintWithMints` that allows for minting with MINTs that are already owned. + - 50a4e09: - Zora Creator 1155 contracts no longer have a public facing function `computeFreeMintRewards` and `computePaidMintRewards` + - protocol rewards calculation logic has been refactored and moved from the RewardSplits contract to the ZoraCreator1155Impl itself to save on contract size. + - remove `ZoraCreator1155Impl.adminMintBatch` to save contract size + - 50a4e09: - To support the MINTs contract passing the first minter as an argument to `premintV2WithSignerContract` - we add the field `firstMinter` to `premintV2WithSignerContract`, and then in the 1155 check that the firstMinter argument is not address(0) since it now can be passed in manually. + +### ZoraCreator1155Impl rewards splits are percentage based instead of a fixed value. + +Prior to 2.9.0, rewards were distributed based on a fixed value in ETH per token minted. From 2.9.0 rewards are distributed based on a percentage of the total reward collected for a mint. The following table breaks down the reward splits for both free and paid mints before and after 2.9.0: + +| Reward Type | Free Mints (Prior to 2.9.0) | Paid Mints (Prior to 2.9.0) | Free Mints (After 2.9.0) | Paid Mints (After 2.9.0) | +| ---------------------- | --------------------------- | --------------------------- | ------------------------ | ------------------------ | +| Creator Reward | 0.000333 ETH per token | - | 42.8571% of total reward | - | +| First Minter Reward | 0.000111 ETH | 0.000111 ETH per token | 14.2285% | 28.5714% of total reward | +| Create Referral Reward | 0.000111 ETH | 0.000222 ETH | 14.2285% | 28.5714% | +| Mint Referral Reward | 0.000111 ETH | 0.000222 ETH | 14.2285% | 28.5714% | +| Zora Platform Reward | 0.000111 ETH | 0.000222 ETH | 14.2285% | 28.5714% | + +## 2.8.1 + +### Patch Changes + +- c2a0a2b: Moved dev time dependencies to devDependencies since they are not needed by external users of the package, they are only used for codegen + +## 2.8.0 + +### Minor Changes + +- 13a4785: Adds ERC20 Minter contract which enables zora 1155 creator NFTs to be minted with ERC20 tokens + +### Patch Changes + +- 13a4785: Adds first minter reward to ERC20 Minter +- 1cf02a4: Add ERC7572 ContractURIUpdated() event for indexing +- 079a596: Moved shared functionality into shared-contracts. premintWithSignerContract takes firstMinter as an argument + +## 2.8 + +- 13a4785: Adds ERC20 Minter which allows users to mint NFTs with ERC20 tokens. + +## 2.7.3 + +### Patch Changes + +- 52b16aa: Publishing package in format that supports commonjs imports by specifying exports. + +## 2.7.2 + +### Patch Changes + +- acf21c0: + - `ZoraCreator1155PremintExecutorImpl` and `ZoraCreator1155Impl` support EIP-1271 based signatures for premint token creation, by taking in an extra param indicating the signing contract, and if that parameter is passed, calling a function on that contract address to validate the signature. EIP-1271 is not supported with PremintV1 signatures. + - `ZoraCreator1155Impl` splits out `supportsInterface` check for premint related functionality into two separate interfaces to check for, allowing each interface to be updated independently. + +## 2.7.1 + +### Patch Changes + +- 8107ffe: Preminter impl disables initializers + +## 2.7.0 + +### Minor Changes + +- e990b9d: Remove platform referral from RewardsSplits. Use new signature for 1155 for `mint` which takes an array of reward recipients. + +### Patch Changes + +- Updated dependencies [e990b9d] + - @zoralabs/protocol-rewards@1.2.3 + +## 2.5.4 + +### Patch Changes + +- 7e00197: \* For premintV1 and V2 - mintReferrer has been changed to an array `mintRewardsRecipients` - which the first element in array is `mintReferral`, and second element is `platformReferral`. `platformReferral is not used by the premint contract yet`. + +## 2.5.3 + +### Patch Changes + +- d9f3596: For premint - fix bug where fundsRecipient was not set on the fixed price minter. Now it is properly set to the royaltyRecipient/payoutRecipient + +## 2.5.2 + +### 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 + +## 2.5.1 + +### Patch Changes + +- 18de283: Fixed setting uid when doing a premint v1 + +## 2.5.0 + +### Minor Changes + +- d84721a: # Premint v2 + + ### New fields on signature + + Adding a new `PremintConfigV2` struct that can be signed, that now contains a `createReferral`. `ZoraCreator1155PremintExecutor` recognizes new version of the premint config, and still works with the v1 (legacy) version of the `PremintConfig`. Version one of the premint config still works and is still defined in the `PremintConfig` 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 contract + - `tokenConfig.royaltyRecipient` has been renamed to `tokenConfig.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 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. + + ### New MintArguments on premint functions, specifying `mintRecipient` and `mintReferral` + + `mintReferral` and `mintRecipient` are now specified in the premint functions on the `ZoraCreator1155PremintExecutor`, via the `MintArguments mintArguments` param; new `premintV1` and `premintV2` functions take a `MintArguments` struct as an argument which contains `mintRecipient`, defining which account will receive the minted tokens, `mintComment`, and `mintReferral`, 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 function `isValidSignature(contractConfig, premintConfig)` is deprecated in favor of: + + ```solidity + 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 the `payoutRecipient` of the premint config on `PremintConfigV2`, and to the `royaltyRecipient` 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 contain `createReferral`, and now look like: + + ```solidity + 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**: + + ```solidity + 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; + // deprecated 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 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 + + ```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 `isAuthorizedToCreatePremint` 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 signature the contract supports, and added corresponding method `ZoraCreator1155Impl.supportedPremintSignatureVersions()` to fetch supported version. If premint not supported, returns an empty array. +- cacb543: Added impl getter to premint executor + +## 2.4.1 + +### Patch Changes + +- 63ef7f6: Added missing functions to IZoraCreator1155 + +## 2.4.0 + +### Minor Changes + +- 366ac20: Fix broken storage layout by not including an interface on CreatorRoyaltiesControl +- e25ac54: ignore nonzero supply royalty schedule + +## 2.3.1 + +### Patch Changes + +- e6f61a9: Include all minter and royalty errors in erc1155 and premint executor abis + +## 2.3.0 + +### Minor Changes + +- 4afa879: Creator reward recipient can now be defined on a token by token basis. This allows for multiple creators to collaborate on a contract and each to receive rewards for the token they created. The royaltyRecipient storage field is now used to determine the creator reward recipient for each token. If that's not set for a token, it falls back to use the contract wide fundsRecipient. + +## 2.1.0 + +### Minor Changes + +- 9495c34: Supply royalties are no longer supported + +## 2.0.4 + +### Patch Changes + +- 64da698: Exporting abi + +## 2.0.3 + +### Patch Changes + +- d3ddfbb: fix version packages tests + +## 2.0.2 + +### Patch Changes + +- 9207e8f: Deployed deterministic proxies and latest versions to mainnet, goerli, base, base goerli, optimism, optimism goerli + +## 2.0.1 + +### Patch Changes + +- 35db763: Adding in built artifacts to package + +## 2.0.0 + +### Major Changes + +- 82f6506: Premint with Delegated Minting + Deterministic Proxy Addresses + Premint deployed to zora and zora goerli + +## 1.6.1 + +### Patch Changes + +- b83e1b6: Add first minter payouts as chain sponsor + +## 1.6.0 + +### Minor Changes + +- 399b8e6: Adds first minter rewards to zora 1155 contracts. +- 399b8e6: Added deterministic contract creation from the Zora1155 factory, Preminter, and Upgrade Gate +- 399b8e6: Added the PremintExecutor contract, and updated erc1155 to support delegated minting + +* Add first minter rewards +* [Separate upgrade gate into new contract](https://github.com/ourzora/zora-1155-contracts/pull/204) + +## 1.5.0 + +### Minor Changes + +- 1bf2d52: Add TokenId to redeemInstructionsHashIsAllowed for Redeem Contracts +- a170f1f: - Patches the 1155 `callSale` function to ensure that the token id passed matches the token id encoded in the generic calldata to forward + - Updates the redeem minter to v1.1.0 to support b2r per an 1155 token id + +### Patch Changes + +- b1dbb47: Fix types reference for package export +- 4cb56d4: - Ensures sales configs can only be updated for the token ids specified + - Deprecates support with 'ZoraCreatorRedeemMinterStrategy' v1.0.1 + +## 1.4.0 + +### Minor Changes + +- 5b3fafd: Change permission checks for contracts – fix allowing roles that are not admin assigned to tokenid 0 to apply those roles to any token in the contract. +- 9f6510d: Add support for rewards + + - Add new minting functions supporting rewards + - Add new "rewards" library + +## 1.3.3 + +### Patch Changes + +- 498998f: Added pgn sepolia + Added pgn mainnet +- cc3b55a: New base mainnet deploy diff --git a/docs/pages/changelogs/protocol-deployments.mdx b/docs/pages/changelogs/protocol-deployments.mdx new file mode 100644 index 00000000..a0f1177c --- /dev/null +++ b/docs/pages/changelogs/protocol-deployments.mdx @@ -0,0 +1,277 @@ +# @zoralabs/protocol-deployments Changelog + + +## 0.3.2 + +### Patch Changes + +- [247ebc86](https://github.com/ourzora/zora-protocol/commit/247ebc86): update for timed sales v2 +- [24520e9a](https://github.com/ourzora/zora-protocol/commit/24520e9a): Fix sdk setSale for v2 params + +## 0.3.1 + +### Patch Changes + +- [d221894d](https://github.com/ourzora/zora-protocol/commit/d221894d): Fix royalties contract address. Include secondary swap address +- [f94e5f03](https://github.com/ourzora/zora-protocol/commit/f94e5f03): Deployed secondary swap to rest of chains + +## 0.3.0 + +### Minor Changes + +- [58f59243](https://github.com/ourzora/zora-protocol/commit/58f59243): Including erc20z contracts in protocol-deployments + +### Patch Changes + +- [b5a7fac4](https://github.com/ourzora/zora-protocol/commit/b5a7fac4): Deployed latest 1155 to base and base sepolia + +## 0.2.2 + +### Patch Changes + +- [12909b5b](https://github.com/ourzora/zora-protocol/commit/12909b5b): Export sparks sponsored mints spender abi, address, and typed data definition +- [58914a0c](https://github.com/ourzora/zora-protocol/commit/58914a0c): Deployed latest 1155 version to zora mainnet, zora sepolia, sepolia + +## 0.2.1 + +### Patch Changes + +- [527aa518](https://github.com/ourzora/zora-protocol/commit/527aa518): Move from yarn to pnpm properly pinning deps packages + +## 0.2.0 + +### Minor Changes + +- [0ec838a4](https://github.com/ourzora/zora-protocol/commit/0ec838a4): Publishing Sparks contracts abis and addresses. + +### Patch Changes + +- [898c84a7](https://github.com/ourzora/zora-protocol/commit/898c84a7): [chore] Update dependencies and runtime scripts + + This ensures jobs do not match binary names to make runs less ambigious and also that all deps are accounted for. + +- [e0b5074d](https://github.com/ourzora/zora-protocol/commit/e0b5074d): Updated mainnet 1155 addresses and versions + +## 0.1.13 + +### Patch Changes + +- [9cdd81ac](https://github.com/ourzora/zora-protocol/commit/9cdd81ac): Deployed latest version of 1155 contracts, 1155 factory, preminter, and mints manager to: + + - blast + - Optimism mainnet + - Base + - Arbitrum One + - Arbitrum Sepolia + - Sepolia + +## 0.1.12 + +### Patch Changes + +- [7af9c4db](https://github.com/ourzora/zora-protocol/commit/7af9c4db): Deployed 1155 version 2.9.0 to mainnet, optimism, base, arbitrum one, arbitrum sepolia, blast + +## 0.1.11 + +### Patch Changes + +- [399ba552](https://github.com/ourzora/zora-protocol/commit/399ba552): Deployed deterministic proxies to base sepolia. Deployed latest versions to base sepolia. + +## 0.1.10 + +### Patch Changes + +- [16deff0c](https://github.com/ourzora/zora-protocol/commit/16deff0c): Moved typed data definitions from `@zoralabs/protocol-sdk` to `@zoralabs/protocol-deployments` + +## 0.1.9 + +### Patch Changes + +- [f4641f4b](https://github.com/ourzora/zora-protocol/commit/f4641f4b): Removed dependencies from `zora-1155-contracts`, `1155-deployments`, `mints-contracts`, and `mints-deployments` + +## 0.1.8 + +### Patch Changes + +- 8e514b7: Deployed lateset MintsEthUnwrapperAndCaller to chains + +## 0.1.7 + +### Patch Changes + +- b6fc3a4: Deployed latest ZoraMintsManagerImpl to zora and zora-sepolia +- 5e6a4b0: Added Protocol Rewards and ERC20 Minter abis and addresses to protocol-deployments + +## 0.1.6 + +### Patch Changes + +- 9a16b81: Remove graphql-request from hard dependencies in protocol sdk + +## 0.1.5 + +### Patch Changes + +- 042edbe: Chain ids in published protocol-deployments package are now numbers instead of strings +- 50a4e09: Includes MINTs contracts abis and addresses + +## 0.1.4 + +### Patch Changes + +- c2a0a2b: Moved dependencies to devDependencies since they are not needed by external users of the package, they are only used for codegen + +## 0.1.3 + +### Patch Changes + +- bb163d3: New preminter impl deployed to mainnet chains + +## 0.1.2 + +### Patch Changes + +- 52b16aa: Publishing package in format that supports commonjs imports by specifying exports +- Updated dependencies [52b16aa] + - @zoralabs/zora-1155-contracts@2.7.3 + +## 0.1.1 + +### Patch Changes + +- 8d6163c: Deployed to blast & blast sepolia. + +## 0.1.0 + +### Minor Changes + +- 653f625: + - Configs & addresses bundled in the following format: `contracts{contractName}/addresses|chainConfigs/{chainId}/config` + - Including bundled json output for each set of configs/addresses for a contract in the folder `bundled-configs` + +## 0.0.14 + +### Patch Changes + +- Added back protocol-deployments - bundling 1155-deployments into it + +## 0.0.13 + +### Patch Changes + +- f3332ee: Remove pgn chain configs and addresses +- d2085fd: Deployed to Arbitrum One & Arbitrum Sepolia +- a51a0cb: Renamed protocol-deployments to 1155-deployments +- Updated dependencies [8107ffe] + - @zoralabs/zora-1155-contracts@2.7.1 + +## 0.0.12 + +### Patch Changes + +- 3af77cf: Deploy 2.7.0 to mainnet, zora mainnet, zora sepolia, zora goerli, optimism, base +- 23dba1c: Deployed all contracts to sepolia + +## 0.0.11 + +### Patch Changes + +- bff853a: Include latest abi in protocol deployments + +## 0.0.10 + +### Patch Changes + +- 68c70a9: Tie protocol deployments to v2.5.4 of 1155 +- Updated dependencies [f0c380d] +- Updated dependencies [98e78d7] +- Updated dependencies [050b689] +- Updated dependencies [3f8b18f] + - @zoralabs/zora-1155-contracts@2.6.0 + +## 0.0.9 + +### Patch Changes + +- 5156b9e: Deploy latest premint executor to zora sepolia and goerli +- Updated dependencies [7e00197] + - @zoralabs/zora-1155-contracts@2.5.4 + +## 0.0.8 + +### Patch Changes + +- 4b77307: Deployed 3.5.3 to zora sepolia and goerli + +## 0.0.7 + +### 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/zora-1155-contracts@2.5.2 + +## 0.0.6 + +### Patch Changes + +- f3b7df8: Deployed 2.4.0 with collaborators to zora-goerli, zora-sepolia, base, optimism, mainnet +- Updated dependencies [885ffa4] +- Updated dependencies [ffb5cb7] +- Updated dependencies [ffb5cb7] +- Updated dependencies [d84721a] +- Updated dependencies [cacb543] + - @zoralabs/zora-1155-contracts@2.5.0 + +## 0.0.5 + +### Patch Changes + +- 293e2c0: Moved deployment related code from 1155 to protocol-deployments package + +## 0.0.4 + +### Patch Changes + +- 6cfb6f9: Add Zora mainnet 1155 v2.3.1 deploy + +## 0.0.3 + +### Patch Changes + +- 85bdd23: Update Zora Network addresses to v2.3.0 + +## 0.0.2 + +### Patch Changes + +- 4d79b49: Deployed to zora sepolia +- b62e471: created new package `protocol-deployments` that includes the deployed contract addresses. + + - 1155-contracts js no longer exports deployed addresses, just the abis + - premint-sdk imports deployed addresses from `protocol-deployments + +- 7d1a4c1: Deployed 2.3.0 to zora goerli + +## 0.0.2-premint-api.2 + +### Patch Changes + +- c29e080: Update retry and error reporting + +## 0.0.2-premint-api.1 + +### Patch Changes + +- 6eaf7bb: add retries + +## 0.0.2-premint-api.0 + +### Patch Changes + +- Updated dependencies [8395b8e] +- Updated dependencies [aae756b] +- Updated dependencies [cf184b3] + - @zoralabs/zora-1155-contracts@2.1.1-premint-api.0 diff --git a/docs/pages/changelogs/protocol-sdk.mdx b/docs/pages/changelogs/protocol-sdk.mdx new file mode 100644 index 00000000..10a0f5fc --- /dev/null +++ b/docs/pages/changelogs/protocol-sdk.mdx @@ -0,0 +1,438 @@ +# @zoralabs/protocol-sdk Changelog + + +## 0.9.6 + +### Patch Changes + +- [24520e9a](https://github.com/ourzora/zora-protocol/commit/24520e9a): Fix sdk setSale for v2 params +- Updated dependencies [247ebc86](https://github.com/ourzora/zora-protocol/commit/247ebc86) +- Updated dependencies [24520e9a](https://github.com/ourzora/zora-protocol/commit/24520e9a) + - @zoralabs/protocol-deployments@0.3.2 + +## 0.9.5 + +### Patch Changes + +- [879a019a](https://github.com/ourzora/zora-protocol/commit/879a019a): - Fixed types, defaults, and queries for v2 timed sales + +## 0.9.4 + +### Patch Changes + +- [b9fcab20](https://github.com/ourzora/zora-protocol/commit/b9fcab20): Removed unneeded async in token setup +- Updated dependencies [d221894d](https://github.com/ourzora/zora-protocol/commit/d221894d) +- Updated dependencies [f94e5f03](https://github.com/ourzora/zora-protocol/commit/f94e5f03) +- Updated dependencies [1b4d5ee7](https://github.com/ourzora/zora-protocol/commit/1b4d5ee7) + - @zoralabs/protocol-deployments@0.3.1 + +## 0.9.3 + +### Patch Changes + +- [c75eb65b](https://github.com/ourzora/zora-protocol/commit/c75eb65b): Fix bug where for timed sale strategy, sales settings were not being set. For getting default erc20 name, get it from the contract name instead of fetching from ipfs. + +## 0.9.2 + +### Patch Changes + +- [5f964909](https://github.com/ourzora/zora-protocol/commit/5f964909): To speed up performance for `create1155OnExistingContract`, use subgraph to get contract info and reduce quantity of rpc reads. + +## 0.9.1 + +### Patch Changes + +- [f40c4a8f](https://github.com/ourzora/zora-protocol/commit/f40c4a8f): `create1155` and `create1155OnExistingContract` return an async `prepareMint` function, enabling to mint right after creating without needing to rely on the subgraph. + +## 0.9.0 + +### Minor Changes + +- [8c50a99c](https://github.com/ourzora/zora-protocol/commit/8c50a99c): Add support for creating 1155s and collecting using the new ZoraTimedSaleStrategy. Default to using the new ZoraTimedSaleStrategy as a minter for new 1155s. + +### Patch Changes + +- [47c20f4d](https://github.com/ourzora/zora-protocol/commit/47c20f4d): - Added support for allowlist mint creation and collection + - For creating an erc20 mint, the parameter `type` must be set to `erc20Mint` on the `token.salesConfig` object + +## 0.8.0 + +### Minor Changes + +- [5417f4dd](https://github.com/ourzora/zora-protocol/commit/5417f4dd): ProtocolSdk `create1155` can only be used for new contracts, and returns the correct deterministic contract address. A new function `create1155OnExistingContract` is added to support creating 1155 tokens on existing contracts + +## 0.7.6 + +### Patch Changes + +- Updated dependencies [58f59243](https://github.com/ourzora/zora-protocol/commit/58f59243) +- Updated dependencies [b5a7fac4](https://github.com/ourzora/zora-protocol/commit/b5a7fac4) + - @zoralabs/protocol-deployments@0.3.0 + +## 0.7.5 + +### Patch Changes + +- [12909b5b](https://github.com/ourzora/zora-protocol/commit/12909b5b): Renamed Mints to Sparks +- Updated dependencies [12909b5b](https://github.com/ourzora/zora-protocol/commit/12909b5b) +- Updated dependencies [58914a0c](https://github.com/ourzora/zora-protocol/commit/58914a0c) + - @zoralabs/protocol-deployments@0.2.2 + +## 0.7.4 + +### Patch Changes + +- [527aa518](https://github.com/ourzora/zora-protocol/commit/527aa518): Move from yarn to pnpm properly pinning deps packages +- Updated dependencies [527aa518](https://github.com/ourzora/zora-protocol/commit/527aa518) + - @zoralabs/protocol-deployments@0.2.1 + +## 0.7.3 + +### Patch Changes + +- [898c84a7](https://github.com/ourzora/zora-protocol/commit/898c84a7): [chore] Update dependencies and runtime scripts + + This ensures jobs do not match binary names to make runs less ambigious and also that all deps are accounted for. + +- Updated dependencies [898c84a7](https://github.com/ourzora/zora-protocol/commit/898c84a7) +- Updated dependencies [0ec838a4](https://github.com/ourzora/zora-protocol/commit/0ec838a4) +- Updated dependencies [e0b5074d](https://github.com/ourzora/zora-protocol/commit/e0b5074d) + - @zoralabs/protocol-deployments@0.2.0 + +## 0.7.2 + +### Patch Changes + +- [cd5ac235](https://github.com/ourzora/zora-protocol/commit/cd5ac235): protocol sdk gets mint price from the default mint price entity on the subgraph + +## 0.7.1 + +### Patch Changes + +- [5c009569](https://github.com/ourzora/zora-protocol/commit/5c009569): Added metadata builder methods to sdk. sdk's method createPremint returns collect/manage urls + +## 0.7.0 + +### Minor Changes + +- [f52f28f3](https://github.com/ourzora/zora-protocol/commit/f52f28f3): Added methods to Collector Client: getToken, getTokensOfContract + +## 0.6.0 + +### Minor Changes + +- [8c23f05b](https://github.com/ourzora/zora-protocol/commit/8c23f05b): - new high-level sdks: `createCreatorClient` and `createCollectorClient`. `createPremintClient`, `createMintClient`, `create1155CreatorClient`, and `createPremintClient` are removed. + - external apis, such as the premint api can be stubbed/replaced/mocked. + - new function `mint` on the collector sdk that works with `1155`, `premint`, and `721`s. + - `create1155` now supports creating erc20, free, and paid mints. Setup actions now mimic what's on zora.co. + +### Patch Changes + +- [b0f0fb74](https://github.com/ourzora/zora-protocol/commit/b0f0fb74): premintClient - fix default mint duration to be unlimited (it was one week before) + +## 0.5.17 + +### Patch Changes + +- [b16078bc](https://github.com/ourzora/zora-protocol/commit/b16078bc): + - premintClient now supports creating/minting premints with additional admins. + - premint client supports creating premints with just a collection address, as long as the premint has been brought onchain +- [502f3295](https://github.com/ourzora/zora-protocol/commit/502f3295): premint sdk - on createPremint, `payoutRecipient` argument moved to `tokenCreationConfig`. premintConfigVersion is no longer an argument; the sdk automatically figures out which is the appropriate version +- Updated dependencies [9cdd81ac](https://github.com/ourzora/zora-protocol/commit/9cdd81ac) + - @zoralabs/protocol-deployments@0.1.13 + +## 0.5.16 + +### Patch Changes + +- [12387133](https://github.com/ourzora/zora-protocol/commit/12387133): `create1155CreatorClient` requires `chain` to be passed as a default argument instead of a `publicClient` +- Updated dependencies [7af9c4db](https://github.com/ourzora/zora-protocol/commit/7af9c4db) + - @zoralabs/protocol-deployments@0.1.12 + +## 0.5.15 + +### Patch Changes + +- [888168b8](https://github.com/ourzora/zora-protocol/commit/888168b8): Fix protocol-sdk to point to `isAuthorizedToCreatePremint` +- [344f452b](https://github.com/ourzora/zora-protocol/commit/344f452b): Add support for ERC-20 minting on 1155s using ERC20 minters within the function `makePrepareMintTokenParams`. + +## 0.5.14 + +### Patch Changes + +- [1a4aa02d](https://github.com/ourzora/zora-protocol/commit/1a4aa02d): Remove graphql-request library and add base sepolia +- Updated dependencies [399ba552](https://github.com/ourzora/zora-protocol/commit/399ba552) + - @zoralabs/protocol-deployments@0.1.11 + +## 0.5.13 + +### Patch Changes + +- [16deff0c](https://github.com/ourzora/zora-protocol/commit/16deff0c): Moved typed data definitions from protocol-sdk to protocol-deployments +- Updated dependencies [16deff0c](https://github.com/ourzora/zora-protocol/commit/16deff0c) + - @zoralabs/protocol-deployments@0.1.10 + +## 0.5.12 + +### Patch Changes + +- [e2452f7d](https://github.com/ourzora/zora-protocol/commit/e2452f7d): Removed `zora-1155-contracts`, `1155-deployments`, `mints-contracts`, and `mints-deployments` from devDependencies hierarchy. + +## 0.5.11 + +### Patch Changes + +- 8e514b7: Cleanup protocol-sdk to have better docs around all methods, and remove methods that do not need to be exported and are not used. +- 598a95b: Bumps protocol-sdk to use viem@2.x- see the [viem 2.X.X migration guide](https://viem.sh/docs/migration-guide#2xx-breaking-changes) for breaking changes when migratring from viem 1.X.X to 2.X.X +- Updated dependencies [8e514b7] + - @zoralabs/protocol-deployments@0.1.8 + +## 0.5.10 + +### Patch Changes + +- Updated dependencies [9a16b81] + - @zoralabs/protocol-deployments@0.1.6 + +## 0.5.9 + +### Patch Changes + +- 825e5f7: Adds optional `createReferral` to `createNew1155Token` params + +## 0.5.8 + +### Patch Changes + +- 50a4e09: Added sdk method to get total MINT balance +- Updated dependencies [042edbe] +- Updated dependencies [50a4e09] + - @zoralabs/protocol-deployments@0.1.5 + +## 0.5.7 + +### Patch Changes + +- 2eda168: Update default premint version to v2 +- 4066420: Adding protocol SDK to base and sepolia networks +- Updated dependencies [bb163d3] + - @zoralabs/protocol-deployments@0.1.3 + +## 0.5.6 + +### Patch Changes + +- 52b16aa: Publishing package in format that supports commonjs imports by specifying exports +- Updated dependencies [52b16aa] + - @zoralabs/protocol-deployments@0.1.2 + +## 0.5.5 + +### Patch Changes + +- 8a87809: Undo changes to package export because it didn't properly bundle all files in `dist` + +## 0.5.4 + +### Patch Changes + +- 9710e5e: Defining exports in protocol-sdk + +## 0.5.3 + +### Patch Changes + +- a07499d: Allows an `Account` object to be passed for `signTypedData` compatiblity with Local Accounts + +## 0.5.2 + +### Patch Changes + +- 5c536dc: Update optimism eth constant +- Updated dependencies [f3332ee] +- Updated dependencies [d2085fd] +- Updated dependencies [a51a0cb] + - @zoralabs/1155-deployments@0.0.13 + +## 0.5.1 + +### Patch Changes + +- 73070c0: + - Fix types export - make sure that types are exported to the correct directory. Broken by commit 627f8c37716f0b5c201f75ab1d025ae878be0ae29e7a269d21185fa04e4bcf93 + - Exclude tests from built bundle + - Fixes #396 + +## 0.5.0 + +### Minor Changes + +- a52d245: Fix premint v2 support in premint client and add support for sepolia to SDK: + + - Fix chain constants config for Zora Goerli. + - Support Zora-Sepolia for premint client. + - Fix passing of `config_version` to and from the backend API. + - Change parameter on `makeMintParameters` from `account` to `minterAccount`. + - Fix price minter address for premint client by chain, since it is not the same on all chains (yet). + +### Patch Changes + +- Updated dependencies [3af77cf] +- Updated dependencies [23dba1c] + - @zoralabs/protocol-deployments@0.0.12 + +## 0.4.3 + +### Patch Changes + +- 92b1b0e: Export premint conversions + +## 0.4.2 + +### Patch Changes + +- 9b03ed2: Support premint v2 in sdk +- Updated dependencies [bff853a] + - @zoralabs/protocol-deployments@0.0.11 + +## 0.4.1 + +### Patch Changes + +- 7e00197: \* For premintV1 and V2 - mintReferrer has been changed to an array `mintRewardsRecipients` - which the first element in array is `mintReferral`, and second element is `platformReferral`. `platformReferral is not used by the premint contract yet`. +- 0ceb709: Add mint costs getter for premint to protocol sdk +- Updated dependencies [5156b9e] + - @zoralabs/protocol-deployments@0.0.9 + +## 0.4.0 + +### Minor Changes + +- 28884c9: \* `PremintClient` now takes a premint config v1 or v2, and a premint config version, for every call to create/update/delete a premint. PremintClient methods have been simplified and are easier to use - for example `createPremint` no longer allows to specify `deleted` = true. For `makeMintParameters` - it now just takes the uid and contract address (instead of full premint config) + - `PremintAPIClient` now converts entities to contract entities before returning them, and correspondingly expects them as contract entities when passed in. It internally converts them to backend entities before sending them to the backend. + +### Patch Changes + +- Updated dependencies [4b77307] + - @zoralabs/protocol-deployments@0.0.8 + +## 0.3.5 + +### Patch Changes + +- 7eb5e3f: ### Changes to `preminter` + + lower level `preminter.ts` now supports premint v2 by defining v2 typed data defintions. + + - `isValidSignature` now takes either v1 or v2 of a premint config, along with the premint config version. and both recovers the signer address and validates if the signer can create a premint on the given contract. + - new function `premintTypedDataDefinition` which takes a premint config version and returns the signable typed data definition for that version + - new function `recoverCreatorFromCreatorAttribution` which recovers the creator address from a `CreatorAttribution` event + - new function `supportsPremintVersion` which checks if a given token contract supports a given premint config version + - new function `tryRecoverPremintSigner` which takes a premint config version and a premint signature, and tries to recover the signer address from the signature. If the signature is invalid, it returns undefined. + + ### Changes to PremintClient + + `PremintClient` creation, updating, and deletion now take both premint config v1 and v2, but currently rejects them until the backend api supports creating v2 premints. + + - `isValidSignature` now just takes the data directly as a param, instead of `{data}` + +- 27a2e23: Fix reading the FIXED_PRICE_MINTER from the subgraph + +## 0.3.4 + +### Patch Changes + +- ea27f01: Fix reading the FIXED_PRICE_MINTER from the subgraph + +## 0.3.3 + +### Patch Changes + +- 97f58b3: `MintAPIClient` is now a class, that takes a chain id and httpClient in the constructor, enabling the httpClient methods `fetch`, `post`, and `retries` 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 than `getMintable`. + + `MintClient` now takes the optional `PublicClient` 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 optional `httpClient` param in the constructor, allowing the `fetch`, `post`, and `retries` 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. + +- d02484e: premintClient can have http methods overridable via DI, and now takes publicClient and http overrides in `createPremintClient` function. it no longer takes `publicClient` as an argument in functions, and rather uses them from the constructor. `executePremint` has been renamed ot `makeMintParameters` + +## 0.3.2 + +### 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/protocol-deployments@0.0.6 + +## 0.3.1 + +### Patch Changes + +- 92da3ed: Exporting mint client +- Updated dependencies [293e2c0] + - @zoralabs/protocol-deployments@0.0.5 + +## 0.3.0 + +### Minor Changes + +- 40e0b32: + - rename premint-sdk to protocol-sdk + - added minting sdk, usable with `createMintClient` + - added 1155 creation sdk, usable with `create1155CreatorClient` + - premint sdk is now useable with `createPremintClient` + +## 0.1.1 + +### Patch Changes + +- b62e471: created new package `protocol-deployments` that includes the deployed contract addresses. + + - 1155-contracts js no longer exports deployed addresses, just the abis + - premint-sdk imports deployed addresses from `protocol-deployments + +- Updated dependencies [4d79b49] +- Updated dependencies [b62e471] +- Updated dependencies [7d1a4c1] + - @zoralabs/protocol-deployments@0.0.2 + +## 0.1.0 + +### Minor Changes + +- 4afa879: Added new premint api that abstracts out calls to the chain signature and submission logic around submitting a premint. This change also incorporates test helpers for premints and introduces docs and an api client for the zora api's premint module. + +### Patch Changes + +- Updated dependencies [4afa879] + - @zoralabs/zora-1155-contracts@2.3.0 + +## 0.0.2-premint-api.2 + +### Patch Changes + +- c29e080: Update retry and error reporting + +## 0.0.2-premint-api.1 + +### Patch Changes + +- 6eaf7bb: add retries + +## 0.0.2-premint-api.0 + +### Patch Changes + +- Updated dependencies [8395b8e] +- Updated dependencies [aae756b] +- Updated dependencies [cf184b3] + - @zoralabs/zora-1155-contracts@2.1.1-premint-api.0 diff --git a/docs/scripts/copy-changelogs.ts b/docs/scripts/copy-changelogs.ts new file mode 100644 index 00000000..6aae0f59 --- /dev/null +++ b/docs/scripts/copy-changelogs.ts @@ -0,0 +1,57 @@ +import { readFile, writeFile } from "fs/promises"; +import { fileURLToPath } from "url"; +import { dirname, join } from "path"; + +const __filename = fileURLToPath(import.meta.url); +const __dirname = dirname(__filename); + +async function copyChangelog( + sourceChangelogPath: string, + destinationChangelogPath: string, + packageName: string, +) { + const changelog = await readFile(sourceChangelogPath, "utf8"); + + // Delete first line and join the rest + const lines = changelog.split("\n"); + let newChangelog = lines.slice(1).join("\n"); + + // Insert the new title + newChangelog = `# ${packageName} Changelog\n\n${newChangelog}`; + + // Replace commit hashes with links to GitHub commits + newChangelog = newChangelog.replace( + /\[([0-9a-f]{8})\]/g, + "[$1](https://github.com/ourzora/zora-protocol/commit/$1)", + ); + + // Add links to commit hashes in changelog entries + newChangelog = newChangelog.replace( + /^- ([0-9a-f]{8}):/gm, + "- [$1](https://github.com/ourzora/zora-protocol/commit/$1):", + ); + + await writeFile(destinationChangelogPath, newChangelog, "utf8"); +} + +async function main() { + await copyChangelog( + join(__dirname, "../../packages/protocol-sdk/CHANGELOG.md"), + join(__dirname, "../pages/changelogs/protocol-sdk.mdx"), + "@zoralabs/protocol-sdk", + ); + + await copyChangelog( + join(__dirname, "../../packages/protocol-deployments/CHANGELOG.md"), + join(__dirname, "../pages/changelogs/protocol-deployments.mdx"), + "@zoralabs/protocol-deployments", + ); + + await copyChangelog( + join(__dirname, "../../packages/1155-contracts/CHANGELOG.md"), + join(__dirname, "../pages/changelogs/1155-contracts.mdx"), + "Zora 1155 Contracts", + ); +} + +main(); diff --git a/docs/vocs.config.ts b/docs/vocs.config.ts index b4fdda15..1361393a 100644 --- a/docs/vocs.config.ts +++ b/docs/vocs.config.ts @@ -20,6 +20,11 @@ export default defineConfig({ link: "/protocol-sdk/introduction", match: "/protocol-sdk", }, + { + text: "Changelogs", + link: "/changelogs/protocol-sdk", + match: "/changelogs", + }, { text: "Zora Network", link: "/zora-network/intro", @@ -192,6 +197,25 @@ export default defineConfig({ ], }, ], + "/changelogs": [ + { + text: "Changelogs", + items: [ + { + text: "@zoralabs/protocol-sdk", + link: "/changelogs/protocol-sdk", + }, + { + text: "@zoralabs/protocol-deployments", + link: "/changelogs/protocol-deployments", + }, + { + text: "@zoralabs/zora-1155-contracts", + link: "/changelogs/1155-contracts", + }, + ], + }, + ], "/zora-network": [ { text: "ZORA Network", diff --git a/package.json b/package.json index cf6fd97c..5f32b0d1 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,8 @@ "test": "turbo run test", "dev": "turbo run dev", "docs:preview": "pnpm run --filter docs preview", - "update-version": "changeset version && turbo run update-contract-version", + "update-version": "changeset version && pnpm docs:copy-changelogs && turbo run update-contract-version", + "docs:copy-changelogs": "pnpm --filter=docs copy-changelog", "lint": "turbo run lint", "format": "turbo run format", "release": "turbo run build && changeset publish",