Skip to content
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 - get supported premint signature version #303

Merged
merged 1 commit into from
Nov 17, 2023

Conversation

oveddan
Copy link
Collaborator

@oveddan oveddan commented Oct 25, 2023

Added method IZoraCreator1155PremintExecutor.supportedPremintSignatureVersion(contractAddress) that tells what version of the premint signature the contract supports, and added corresponding method ZoraCreator1155Impl.supportedPremintSignatureVersion() to fetch supported version. If premint not supported, returns 0.

@oveddan
Copy link
Collaborator Author

oveddan commented Oct 25, 2023

/// @return The version of the premint signature that the contract supports. If it doesn't support premint
/// returns 0
function supportedPremintSignatureVersion(address contractAddress) external view returns (string memory) {
IZoraCreator1155 creatorContract = IZoraCreator1155(contractAddress);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should version be a string or an integer?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hrrrm great q. when you sign the message, the version according to eip-712 is a string. so maybe it makes sense for this to actually return an array saying supportedSignatureVersions with an array of the versions supported?

or we store internally as integers and convert to string in the eip-712 domain, and this returns a an integer which acts as a max version.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

String is fine for alignment for EIP-712. Another option would be to stringify an integer to come up.

iainnash
iainnash previously approved these changes Oct 26, 2023
Copy link
Collaborator

@iainnash iainnash left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

comment on string/integer

}

// try get token id for uid 0 - if call fails, we know this didn't support premint
try ERC1155DelegationStorageV1(contractAddress).delegatedTokenId(uint32(0)) returns (uint256) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are we somehow ensuring that the first premint executed on a contract is uid 0?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it doesn't really matter here - this is really just checking if that function exists on the contract. even if the uid is not 0, this will return 0. It will revert if the function doesn't exist on the contract

@oveddan oveddan force-pushed the allow-minting-on-v1-contracts branch from 4d8f817 to b13aecc Compare October 26, 2023 18:25
@oveddan oveddan force-pushed the get-supported-premint-version branch from 9a2a7de to 03dd79a Compare October 26, 2023 18:25
try ERC1155DelegationStorageV1(contractAddress).delegatedTokenId(uint32(0)) returns (uint256) {
return "1";
} catch {
return "0";
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we return empty string here?

@oveddan oveddan force-pushed the get-supported-premint-version branch from 73aff5e to a0c248c Compare November 14, 2023 20:06
@oveddan oveddan force-pushed the get-supported-premint-version branch from a0c248c to 6244493 Compare November 14, 2023 23:24
@oveddan oveddan force-pushed the get-supported-premint-version branch from 6244493 to 9a47b0e Compare November 15, 2023 00:45
@oveddan oveddan mentioned this pull request Nov 15, 2023
@oveddan oveddan force-pushed the get-supported-premint-version branch from 9a47b0e to b5f3019 Compare November 15, 2023 01:10
@oveddan oveddan force-pushed the get-supported-premint-version branch from b5f3019 to 24e5de5 Compare November 15, 2023 01:12
@oveddan oveddan force-pushed the get-supported-premint-version branch from 24e5de5 to 9bc75d9 Compare November 15, 2023 01:13
@oveddan
Copy link
Collaborator Author

oveddan commented Nov 15, 2023

Merge activity

  • Nov 15, 2:48 PM: @oveddan started a stack merge that includes this pull request via Graphite.
  • Nov 15, 2:48 PM: Graphite couldn't merge this pull request because a downstack PR Premint V2 #262 failed to merge.

This reverts commit d57f2990d9046c7e9f7d29ec2105902b3bb59830.
@oveddan oveddan changed the base branch from default-msg-sender to main November 17, 2023 16:16
@oveddan oveddan dismissed iainnash’s stale review November 17, 2023 16:16

The base branch was changed.

@oveddan oveddan merged commit ffb5cb7 into main Nov 17, 2023
6 checks passed
iainnash pushed a commit that referenced this pull request Jan 5, 2024
Added method `IZoraCreator1155PremintExecutor.supportedPremintSignatureVersion(contractAddress)` that tells what version of the premint signature the contract supports, and added corresponding method `ZoraCreator1155Impl.supportedPremintSignatureVersion()` to fetch supported version.  If premint not supported, returns 0.
iainnash pushed a commit that referenced this pull request Jan 11, 2024
Added method `IZoraCreator1155PremintExecutor.supportedPremintSignatureVersion(contractAddress)` that tells what version of the premint signature the contract supports, and added corresponding method `ZoraCreator1155Impl.supportedPremintSignatureVersion()` to fetch supported version.  If premint not supported, returns 0.
iainnash pushed a commit that referenced this pull request Jan 11, 2024
Added method `IZoraCreator1155PremintExecutor.supportedPremintSignatureVersion(contractAddress)` that tells what version of the premint signature the contract supports, and added corresponding method `ZoraCreator1155Impl.supportedPremintSignatureVersion()` to fetch supported version.  If premint not supported, returns 0.
@iainnash iainnash deleted the get-supported-premint-version branch January 11, 2024 15:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants