fix: add access control to mintEdition and batchMintEditions#9
Open
ArshLabs wants to merge 1 commit intoc2siorg:mainfrom
Open
fix: add access control to mintEdition and batchMintEditions#9ArshLabs wants to merge 1 commit intoc2siorg:mainfrom
ArshLabs wants to merge 1 commit intoc2siorg:mainfrom
Conversation
mintEdition() and batchMintEditions() had no access control. Any address could mint unlimited editions of any original token, bypassing maxEditions limits and the device-based provenance model. Restricted minting to: - The device address stored in the original token's TokenInfo (proves hardware origin), OR - The contract owner Without this LensMint's core guarantee that editions are tied to the camera that took the photo is meaningless at the contract level.
anurag-p6
reviewed
Mar 19, 2026
anurag-p6
left a comment
There was a problem hiding this comment.
Hello, we don't want only owner to mint the NFT's as owner can create the multiple nft's and share QR amongst others so that they can also mint the NFT. Adding this owner constraint doesn't fit here.
refer - https://ethereum.org/developers/docs/standards/tokens/erc-1155/
thank you :)
This file contains hidden or 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
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.
Problem
mintEdition()andbatchMintEditions()inLensMintERC1155.solhave no access control. Any address can:maxEditionslimitThis breaks the core provenance model. LensMint's value prop is that every edition is cryptographically tied to the device that captured the original photo. Without this check that guarantee means nothing at the contract level.
Fix
Added
UnauthorizedMintercustom error and restricted both functions to the device address stored in the original token'sTokenInfo, or the contract owner.Related
Complements PR #4 (ECDSA signature verification). Together these close the two main authorization gaps in the minting flow.