Day 5 of "Building an Equipment System with Smart Contracts" for @ethgardlegends.
Imagine you find a cool sword and want to equip it to your hero to gain benefits in the game. That's what I'm building.
In technical terms, the goal is to allow NFTs (ERC1155/ERC721) to be equippable on other NFTs (ERC721 => Heroes).
Today's progress:
Made solid progress on the visual side today. Continued development on the UI for the EquipmentSystem, created the slot images for head, shoulders, chest, etc., and started testing the layout using some items. You can see it in the image below. On the left side is the hero with their currently equipped items, and on the right is the "inventory"-items that are unequipped and available.
Aside from UI work, I had to refactor some of the existing backend code to support claiming ERC721 items. The current implementation was tailored for ERC1155s only, so this required a few structural changes. Still a bit of work to go here, but it’s progressing in sync with the rest of the system.
Now for the less fun part - ERC721 minting bug hunting. While minting works flawlessly within the smart contract unit tests, the signature signing used for claims is currently throwing InvalidSignature
errors. Likely just a small encoding issue, but these kinds of bugs are frustrating and time-consuming to track down.
Today's lesson:
You win some, you lose some.
After the high of getting the UI looking good, I ran into some annoying bugs. But that’s just part of the game when it comes to software development.
The important point there is to not get frustrated, to take a break and then keep on coding!
PS: If you're having trouble understanding certain parts but want to learn more, try the AI feature on Peakd or ChatGPT/Grok to have it explained 👍.