Inventory and item NFTs - #72
Merged
Merged
Conversation
|
Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🧪 Coverage
|
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.
Description
Implements roadmap §4: items as ERC-1155 NFTs, an inventory, equipment that
changes how a fight resolves, and battle-reward drops. EVM only; Solana is
deferred per §4's own EVM-first recommendation.
56 commits, 188 files, +16,401 / -293.
Read this part first: merging schedules a re-consent event
ENGINE_VERSIONgoes 1 to 2, andRulesetgains the combat-affecting itemcatalog. Both feed
rulesetHash, so the hash changes for every battle, notonly geared ones. Every outstanding
DefenseAuthorizationis invalidated andevery defender has to re-consent.
That is the designed cost of a rules change and
protocol/src/consent/types.tsdocuments it as such, but it is user-visible and should ship deliberately rather
than land unnoticed.
Both schema versions are append-only, as AGENTS.md requires.
snapshotandrulesetgo to 2, version 1 stays inSUPPORTED_VERSIONSpermanently, and anabsent version still means 1. The first draft defaulted to "current" and 35
receipt vectors caught it immediately.
How it fits together
contracts/ethereumItemCore.sol, an ERC-1155 where the token id is the item type.PetCorerefuses to transfer a geared pet.ItemBalanceandPetEquipmententities with their own start block.services/indexer-gobackendprotocol/verifiershared/frontendservices/image-generatorTesting
go test ./...cleancontracts/test-vectors/battle.jsonandxp.jsonare unchanged and still pass:with no equipment the deltas are zero and the engine stays bit-identical, which
is the compatibility proof. Equipment cases live in a new
equipment.json, readby both live ports. Its first case reproduces a
battle.jsonrow exactly, whichproves an ungeared fight costs nothing rather than merely claiming so.
Already live on Base Sepolia
ItemCoreproxy0xA6F2f05C2721937D0379482CFC39b7aBd641cD30, verifiedPetCoreupgraded to implementation0x98a6d7a6f020a93e8ec6baada869ad879ec32364, verified, with the transfer guard enabled and proven on chain (ungeared transfer allowed, geared reverts withUnequip items before transferring, allowed again after stripping)EVM_SUBGRAPH_URLbumpedscripts/verify-inventory-setup.tspasses 13/13State survived the
PetCoreupgrade intact: 12 pets with names, levels andowners preserved.
itemCorelands on slot 410, previously__gap[0], read aszero on the live proxy before the upgrade.