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

Ensure the same card cannot figure in the same deck multiple time #73

Open
norswap opened this issue Oct 21, 2023 · 2 comments
Open

Ensure the same card cannot figure in the same deck multiple time #73

norswap opened this issue Oct 21, 2023 · 2 comments

Comments

@norswap
Copy link
Member

norswap commented Oct 21, 2023

This should be checked as part of checkDeck in Inventory.sol.

We could modify the sorting doing there to preserve the unique NFT ID, then we only have to check all the instances of a similar card for similarity.

Once we have a frontend deck builder, we should also check this constraints (and others) there at add-time — although they won't be enforced contract-side when adding.

Alternatively, we could get rid of the notion of adding and removing cards from a deck and only mandate that decks are updated wholesale. This is potentially costly in terms of calldata, which is the main cost for rollups, so I do not think it's the way to go.

@Prabhat1308
Copy link

Hi . I would like to work on this issue.

@norswap
Copy link
Member Author

norswap commented Feb 15, 2024

I believe I misunderstood something and @eviterin is actually already working on this! He will confirm.

@eviterin eviterin self-assigned this Mar 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants