In ArtistV4, we want to limit every address to only 1 token per edition. To do this, we give the buyer a requestedTokenId
in a signed message that is validated on chain.
The problem is we are planning to start serving the metadata on chain in a future upgrade and we need a consecutive number to differentiate each token within the edition (ie: serial number). That number can be the numSold
emitted by the EditionPurchased
event when we’re serving the metadata, but that info is inaccessible when the metadata exists on chain. We also can’t use tokenId
unless we can’t enforce all of the tokenId
s will be consecutive, which is not the case with the current ArtistV4 plan.
buyEdition
= $23.3 @ 100 gwei (average-case)createEdition
= $31.50 @ 100 gwei (worse-case)// editionId => buyer address => token id
mapping(uint256 => mapping(address => uint256)) soldTokens;
buyEdition
= $29.4 @ 100 gwei (average-case)createEdition
= $31.50 @ 100 gwei (worse-case)createEdition
depending on how many unique buyers we want to guarantee for the edition (gas stats below are for 1024 unique buyers)