Skip to content

Encode beasts into token IDs#13

Merged
loothero merged 2 commits into
mainfrom
encode-beasts-token-ids
May 21, 2026
Merged

Encode beasts into token IDs#13
loothero merged 2 commits into
mainfrom
encode-beasts-token-ids

Conversation

@loothero

Copy link
Copy Markdown
Member

Summary

  • encode Beast ERC721 token IDs directly from PackableBeast attributes
  • remove stored token_id -> PackableBeast data and decode owned token IDs instead
  • update minting, ranking, metadata, tests, and docs for packed token IDs and supply-count semantics

Notes

  • Fresh deployments only; this intentionally does not support legacy sequential token IDs.
  • Genesis and non-genesis Beasts use the same packed token ID format.
  • total_supply() remains a count of minted NFTs, not the largest token ID.

Tests

  • scarb fmt --check --workspace
  • scarb build
  • snforge test --max-n-steps 4294967295

Copilot AI review requested due to automatic review settings May 21, 2026 02:08

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request transitions the Beasts NFT collection to a deterministic token ID system, where the ERC721 token_id is a 53-bit packed representation of a beast's attributes. This architectural shift removes the need for the beasts storage map, as attributes are now decoded directly from the ID. The update includes refactoring the beasts_nft contract, ranking logic, and metadata generation, alongside comprehensive updates to the test suite to accommodate packed IDs. I have no feedback to provide as no review comments were submitted.

@loothero loothero merged commit 0f80219 into main May 21, 2026
1 of 2 checks passed
@loothero loothero deleted the encode-beasts-token-ids branch May 21, 2026 02:11
@loothero loothero removed the request for review from Copilot May 21, 2026 02:29
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.

2 participants