create account

Day 7 of Building an Equipment System with Smart Contracts (Solidity) by therealwolf

View this thread on: hive.blogpeakd.comecency.com
· @therealwolf ·
$7.77
Day 7 of Building an Equipment System with Smart Contracts (Solidity)
Day 7 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:

Started the day by continuing work on the UI for the equipment system.

While refining the flow, I realised that equipping and unequipping items aren't really two separate actions - they're optimally one single operation.

So I refactored some of the smart contract by removing equipItems/unequipItems in favor of a single changeEquipment function, which takes both the items to equip and the slots to unequip.

Once that was in, I hooked everything up, made some code-magic, and was finally able to equip items onchain for the first time.

In the video below, I'm equipping a Rare ERC1155 Skin and an ERC721 Sword/Shield onto an ERC721 Hero. Items can be equipped/unequipped by dragging as well as right-clicking on them.

https://x.com/thewolfonchain/status/1906460745379827885

Finally, I also added some simple tooltips when hovering over the items. With that, the full core flow is now working. Next up are further improvements, polishing, and getting things production-ready. Check out the demo video:

---

### Today's lesson:

Slow and steady wins the race.

When I first started working on this, the whole thing felt like a huge mountain. I remember thinking, “how the heck am I gonna get all this done?” Now, just a week later, I’m on that mountain, and while I see another one up ahead, I can also look back and appreciate the climb (work) so far.

Just 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 👍._
👍  , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , and 62 others
properties (23)
authortherealwolf
permlinkday-7-of-building-an-equipment-system-with-smart-contracts-solidity
categorybuildinginpublic
json_metadata"{"app":"peakd/2025.3.6","format":"markdown","description":"The core equipment flow is now working! Checkout the video within the post.","tags":["buildinginpublic","ethgardlegends","evm","smartcontracts","ethgard","hive"],"users":["ethgardlegends."],"image":[]}"
created2025-03-30 21:39:09
last_update2025-03-30 21:39:09
depth0
children1
last_payout2025-04-06 21:39:09
cashout_time1969-12-31 23:59:59
total_payout_value3.892 HBD
curator_payout_value3.877 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length1,887
author_reputation582,208,885,469,814
root_title"Day 7 of Building an Equipment System with Smart Contracts (Solidity)"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id141,785,209
net_rshares25,547,209,918,863
author_curate_reward""
vote details (126)
@hivebuzz ·
Congratulations @therealwolf! You have completed the following achievement on the Hive blockchain And have been rewarded with New badge(s)

<table><tr><td><img src="https://images.hive.blog/60x60/https://hivebuzz.me/badges/postallweek.png"></td><td>You have been a buzzy bee and published a post every day of the week.</td></tr>
</table>

<sub>_You can view your badges on [your board](https://hivebuzz.me/@therealwolf) and compare yourself to others in the [Ranking](https://hivebuzz.me/ranking)_</sub>
<sub>_If you no longer want to receive notifications, reply to this comment with the word_ `STOP`</sub>



**Check out our last posts:**
<table><tr><td><a href="/hive-122221/@hivebuzz/pum-202504"><img src="https://images.hive.blog/64x128/https://i.imgur.com/M9RD8KS.png"></a></td><td><a href="/hive-122221/@hivebuzz/pum-202504">Be ready for the April edition of the Hive Power Up Month!</a></td></tr><tr><td><a href="/hive-122221/@hivebuzz/pud-202504"><img src="https://images.hive.blog/64x128/https://i.imgur.com/805FIIt.jpg"></a></td><td><a href="/hive-122221/@hivebuzz/pud-202504">Hive Power Up Day - April 1st 2025</a></td></tr></table>
properties (22)
authorhivebuzz
permlinknotify-1743406759
categorybuildinginpublic
json_metadata{"image":["https://hivebuzz.me/notify.t6.png"]}
created2025-03-31 07:39:18
last_update2025-03-31 07:39:18
depth1
children0
last_payout2025-04-07 07:39:18
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length1,144
author_reputation370,823,385,778,097
root_title"Day 7 of Building an Equipment System with Smart Contracts (Solidity)"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id141,792,437
net_rshares0