-
Notifications
You must be signed in to change notification settings - Fork 113
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Version Packages #367
Version Packages #367
Conversation
5890116
to
51e8771
Compare
packages/1155-contracts/CHANGELOG.md
Outdated
|
||
`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 containe `createReferral`, and now look like: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
smol typo "contain"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah thanks!
packages/1155-contracts/CHANGELOG.md
Outdated
} | ||
``` | ||
|
||
### changes to `ZoraCreator1155PremintExecutorImpl`: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: "Changes" for consistency
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice catch thx
packages/1155-contracts/CHANGELOG.md
Outdated
|
||
### Patch Changes | ||
|
||
- 885ffa4: Premint executor can still execute premint mints on 1155 contracts that were created with the old signature for `delegateSetupNewToken` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe can be more explicit and say "....that were created with V1 signatures for delegateSetupNewToken
" ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep sounds good
approved general feedback is that the details are great for devs, but could be easier to parse with more bullet points, especially for PMs |
5edd2a4
to
c753b6a
Compare
* Version Packages * fix per suggestions * improved changelog --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Dan Oved <[email protected]>
* Version Packages * fix per suggestions * improved changelog --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Dan Oved <[email protected]>
* Version Packages * fix per suggestions * improved changelog --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Dan Oved <[email protected]>
<!--- Provide a general summary of your changes in the Title above --> ## Description <!--- Describe your changes in detail --> The Mints readme had the original design with the fully upgradeable contract. This updates the readme to define the two different contracts. <!--- Why is this change required? What problem does it solve? --> <!--- If it fixes an open issue, please link to the issue here. --> ## Does this change the ABI/API? - [ ] This changes the ABI/API <!-- If so, please describe how and what potential impact this may have --> ## What tests did you add/modify to account for these changes <!--- Please describe in detail how you tested your changes. --> <!--- Include details of your testing environment, tests ran to see how --> <!--- your change affects other areas of the code, etc. --> ## Types of changes <!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: --> - [ ] Bug fix (non-breaking change which fixes an issue) - [ ] New module / feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) ## Checklist: <!--- Go over all the following points, and put an `x` in all the boxes that apply. --> <!--- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> - [ ] My code follows the code style of this project. - [ ] My change requires a change to the documentation. - [ ] I have updated the documentation accordingly. - [ ] i added a changeset to account for this change ## Reviewer Checklist: - [ ] My review includes a symposis of the changes and potential issues - [ ] The code style is enforced - [ ] There are no risky / concerning changes / additions to the PR
This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated.
Releases
@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 thePremintConfig
, and still works with the v1 (legacy) version of thePremintConfig
.Additional changes to the
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
function now take theMintArguments
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.New signature validation methods
ZoraCreator1155PremintExecutor can now validate signatures by passing it the contract address, instead of needing to pass the full contract creation config, enabling it to validate signatures for 1155 contracts that were not created via the premint executor contract. This allows premints signatures to be validated on contracts that have been upgraded to a version that supports premints, and allows premints to be created on contracts that were not created via the premint executor contract. These functions are called
isValidSignatureV1
andisValidSignatureV2
for v1 and v2 of the premint config structs and signatures correspondingly.Changes to handling of setting of fundsRecipient
Previously the
fundsRecipient
on the fixeed 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 for v2 of premint config, 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 and execute a v1 of the premint config.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 containecreateReferral
, and now look like:PremintConfig
fields are the same as they were before, but are treated as a version 1:changes to
ZoraCreator1155PremintExecutorImpl
:premintV1
- takes aPremintConfig
, and premint v1 signature, and executes a premint, with added functionality of being able to specify mint referral and mint recipientpremintV2
- takes aPremintConfigV2
signature and executes a premint, with being able to specify mint referral and mint recipientpremint
- callpremintV1
insteadtakes 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.isValidSignature
- callisAuthorizedToCreatePremint
insteadPatch Changes
delegateSetupNewToken
IZoraCreator1155PremintExecutor.supportedPremintSignatureVersions(contractAddress)
that tells what version of the premint signature the contract supports, and added corresponding methodZoraCreator1155Impl.supportedPremintSignatureVersions()
to fetch supported version. If premint not supported, returns an empty array.@zoralabs/[email protected]
Patch Changes
@zoralabs/[email protected]
Patch Changes
preminter
exposes new function isValidSignatureV1 that recovers a signer from a signed premint and determines if that signer is authorized to sign