-
Notifications
You must be signed in to change notification settings - Fork 103
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
Premint V2 #262
Merged
Merged
Premint V2 #262
+1,122
−334
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
hey this makes sense as a way to support this. |
oveddan
reviewed
Oct 12, 2023
oveddan
reviewed
Oct 12, 2023
oveddan
force-pushed
the
premint_create_referral
branch
from
October 13, 2023 21:10
4127639
to
d20d7f7
Compare
oveddan
force-pushed
the
premint_create_referral
branch
from
October 17, 2023 16:39
d20d7f7
to
985c7ff
Compare
oveddan
force-pushed
the
premint_create_referral
branch
from
October 17, 2023 21:14
985c7ff
to
5ca081e
Compare
oveddan
force-pushed
the
premint_create_referral
branch
from
October 17, 2023 23:58
5ca081e
to
414ea11
Compare
This was referenced Oct 17, 2023
oveddan
changed the base branch from
deprecate_supply_royalty
to
dont-check-royalty-mint-schedule-greater-zero
October 18, 2023 00:06
oveddan
force-pushed
the
premint_create_referral
branch
from
October 18, 2023 00:06
414ea11
to
584f563
Compare
oveddan
force-pushed
the
dont-check-royalty-mint-schedule-greater-zero
branch
from
October 18, 2023 16:39
867b3ca
to
3ffa41e
Compare
oveddan
force-pushed
the
premint_create_referral
branch
from
October 18, 2023 16:39
584f563
to
6abc607
Compare
oveddan
force-pushed
the
dont-check-royalty-mint-schedule-greater-zero
branch
from
October 18, 2023 17:41
3ffa41e
to
29b2b15
Compare
oveddan
changed the base branch from
dont-check-royalty-mint-schedule-greater-zero
to
main
October 18, 2023 19:38
oveddan
force-pushed
the
premint_create_referral
branch
from
October 18, 2023 19:38
6abc607
to
3145165
Compare
Merged
oveddan
changed the base branch from
main
to
creator-reward-recipient-better-docs
October 19, 2023 20:18
oveddan
force-pushed
the
premint_create_referral
branch
from
October 19, 2023 20:18
3145165
to
640736f
Compare
oveddan
force-pushed
the
premint_create_referral
branch
from
November 13, 2023 23:22
afe3ce3
to
1aeeabd
Compare
oveddan
changed the base branch from
move-deployment-utils-to-protocol-deployments
to
11-14-Allow_fork_rpc_and_block_number_to_be_specified
November 14, 2023 20:06
oveddan
force-pushed
the
premint_create_referral
branch
2 times, most recently
from
November 14, 2023 20:06
1aeeabd
to
6e178ec
Compare
oveddan
force-pushed
the
11-14-Allow_fork_rpc_and_block_number_to_be_specified
branch
from
November 14, 2023 23:24
f910167
to
faeff94
Compare
oveddan
force-pushed
the
premint_create_referral
branch
from
November 14, 2023 23:24
6e178ec
to
a1da19c
Compare
oveddan
force-pushed
the
11-14-Allow_fork_rpc_and_block_number_to_be_specified
branch
from
November 15, 2023 00:45
faeff94
to
8e5aed9
Compare
oveddan
force-pushed
the
premint_create_referral
branch
from
November 15, 2023 00:45
a1da19c
to
9d8548b
Compare
This was referenced Nov 15, 2023
Closed
oveddan
force-pushed
the
11-14-Allow_fork_rpc_and_block_number_to_be_specified
branch
from
November 15, 2023 01:10
8e5aed9
to
06db23c
Compare
oveddan
force-pushed
the
premint_create_referral
branch
from
November 15, 2023 01:10
9d8548b
to
9d2c585
Compare
oveddan
force-pushed
the
11-14-Allow_fork_rpc_and_block_number_to_be_specified
branch
from
November 15, 2023 01:12
06db23c
to
cf76fd5
Compare
oveddan
force-pushed
the
premint_create_referral
branch
from
November 15, 2023 01:12
9d2c585
to
7bf9aac
Compare
oveddan
changed the base branch from
11-14-Allow_fork_rpc_and_block_number_to_be_specified
to
main
November 15, 2023 01:13
oveddan
force-pushed
the
premint_create_referral
branch
from
November 15, 2023 01:13
7bf9aac
to
46afabc
Compare
oveddan
approved these changes
Nov 15, 2023
This was referenced Nov 17, 2023
Merged
iainnash
pushed a commit
that referenced
this pull request
Jan 5, 2024
Premint v2 - adding a new signature, where `createReferral` can be specified. `ZoraCreator1155PremintExecutor` recognizes new version of the signature, and still works with the v1 (legacy) version of the signature. 1155 contract has been updated to now take abi encoded premint config, premint config version, and send it to an external library to decode the config, the signer, and setup actions. 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 upgrade to a version that supports premints, and allows premints to be created on contracts that were not created via the premint executor contract. 1155 contract has been updated to now take abi encoded premint config, premint config version, and send it to an external library to decode the config, the signer, and setup actions. changes to `ZoraCreator1155PremintExecutorImpl`: `PremintConfigV2` are updated to containe `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. address payoutAddress; // 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; // RoyaltyMintSchedule for created tokens. Every nth token will go to the royalty recipient. uint32 royaltyMintSchedule; // RoyaltyBPS for created tokens. The royalty amount in basis points for secondary sales. uint32 royaltyBPS; // RoyaltyRecipient for created tokens. The address that will receive the royalty payments. 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 `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. * deprecated function `isValidSignature` - call `isValidSignatureV1` instead
iainnash
pushed a commit
that referenced
this pull request
Jan 11, 2024
Premint v2 - adding a new signature, where `createReferral` can be specified. `ZoraCreator1155PremintExecutor` recognizes new version of the signature, and still works with the v1 (legacy) version of the signature. 1155 contract has been updated to now take abi encoded premint config, premint config version, and send it to an external library to decode the config, the signer, and setup actions. 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 upgrade to a version that supports premints, and allows premints to be created on contracts that were not created via the premint executor contract. 1155 contract has been updated to now take abi encoded premint config, premint config version, and send it to an external library to decode the config, the signer, and setup actions. changes to `ZoraCreator1155PremintExecutorImpl`: `PremintConfigV2` are updated to containe `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. address payoutAddress; // 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; // RoyaltyMintSchedule for created tokens. Every nth token will go to the royalty recipient. uint32 royaltyMintSchedule; // RoyaltyBPS for created tokens. The royalty amount in basis points for secondary sales. uint32 royaltyBPS; // RoyaltyRecipient for created tokens. The address that will receive the royalty payments. 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 `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. * deprecated function `isValidSignature` - call `isValidSignatureV1` instead
iainnash
pushed a commit
that referenced
this pull request
Jan 11, 2024
Premint v2 - adding a new signature, where `createReferral` can be specified. `ZoraCreator1155PremintExecutor` recognizes new version of the signature, and still works with the v1 (legacy) version of the signature. 1155 contract has been updated to now take abi encoded premint config, premint config version, and send it to an external library to decode the config, the signer, and setup actions. 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 upgrade to a version that supports premints, and allows premints to be created on contracts that were not created via the premint executor contract. 1155 contract has been updated to now take abi encoded premint config, premint config version, and send it to an external library to decode the config, the signer, and setup actions. changes to `ZoraCreator1155PremintExecutorImpl`: `PremintConfigV2` are updated to containe `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. address payoutAddress; // 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; // RoyaltyMintSchedule for created tokens. Every nth token will go to the royalty recipient. uint32 royaltyMintSchedule; // RoyaltyBPS for created tokens. The royalty amount in basis points for secondary sales. uint32 royaltyBPS; // RoyaltyRecipient for created tokens. The address that will receive the royalty payments. 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 `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. * deprecated function `isValidSignature` - call `isValidSignatureV1` instead
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Premint v2 - adding a new signature, where
createReferral
can be specified.ZoraCreator1155PremintExecutor
recognizes new version of the signature, and still works with the v1 (legacy) version of the signature. 1155 contract has been updated to now take abi encoded premint config, premint config version, and send it to an external library to decode the config, the signer, and setup actions.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 upgrade to a version that supports premints, and allows premints to be created on contracts that were not created via the premint executor contract.
1155 contract has been updated to now take abi encoded premint config, premint config version, and send it to an external library to decode the config, the signer, and setup actions.
changes to
ZoraCreator1155PremintExecutorImpl
: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
insteadisValidSignatureV1
- 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.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.isValidSignature
- callisValidSignatureV1
instead