Problem

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 tokenIds will be consecutive, which is not the case with the current ArtistV4 plan.

Options

1. require a signature for every purchase of every edition

Untitled

2. store each buyer’s address and increment id on chain

// editionId => buyer address => token id
    mapping(uint256 => mapping(address => uint256)) soldTokens;

Untitled

3. ✅ Use “reserve ticket” idea