Wolf pfp

Wolf

@wolfonchain

66 Following
6 Followers


Wolf pfp
Wolf
@wolfonchain
Today's lesson: Comments, comments, comments. They make a huge difference, especially in smart contract development, where mistakes aren’t acceptable but inefficient code isn’t either. Unlike in TypeScript or Python, where inefficient code is just a performance hit, Solidity has strict size limit, high gas costs and of course security risks due to the code being completely public. Comments help balance efficient code with readability, which provides security. In my case, I was reading through some functions over and over again - code that got complex really quickly. Formatting it properly and writing well-structured comments made it much more readable and easier to work with.
0 reply
0 recast
0 reaction

Wolf pfp
Wolf
@wolfonchain
However, ran into a classic Solidity issue: contract size limits. Solidity contracts have a max size of 24.5kb, and after finishing the implementation, my contract was around 30kb, making it too large to deploy. Spent a few hours optimising the code, trimming unnecessary parts, and reducing contract bloat. Now it's sitting at 23.5kb, which is better but still tight, since more code will likely be added. One thing that surprised me: events take up a lot of space - removing a single event saved about 0.5-1kb. Excited to move into more practical development over the next few days. While contract development is great, it’s really cool to hook the contracts up to an indexer, creating tables that can be queried and displayed in the UI or used elsewhere.
1 reply
0 recast
0 reaction

Wolf pfp
Wolf
@wolfonchain
Today's progress: Finished the equipping/unequipping logic. Items can now be equipped to specific slots like head, chest, main hand, off hand, etc. Most items have a single slot they can be equipped to (e.g., a helmet to a head slot). Others have multiple valid slots (e.g., a one-handed weapon can be equipped to the main hand or off hand), and some take up multiple slots (e.g., a two-handed weapon is equipped in the main hand but also occupies the off-hand slot). Handling all these cases in the equipItems/unequipItems functions took a bit longer than expected, but it's now working. Converting the logic from ERC1155 to ERC721 was also a bit tricky. In ERC1155, the tokenId usually defines the item type (unless it's used to define NFTs via totalSupply 1). In ERC721, the tokenId is unique per NFT, but the item type is separate. All tests are now also passing again after the introduction of the ItemSystem, which is a nice milestone.
1 reply
0 recast
0 reaction

Wolf pfp
Wolf
@wolfonchain
Day 3 of "Building a Solidity-based Equipment System for EthgardLegends.com“ on B3. Size does matter - in today's case: ✨ Smaller is Better! ✨
1 reply
0 recast
0 reaction

Wolf pfp
Wolf
@wolfonchain
Todays lesson: Designing around immutable code really is stressful. Games evolve over time, and ensuring everything is designed correctly from the start is nearly impossible. Still, as mentioned yesterday, it's critical to get it as right as possible before deployment. However, defining the different weapon and armor categories and finalize the item list took quite a bit of work. Once items are minted onchain and in circulation, changes become significantly harder, increasing the pressure to get things right from the start. This led to a lot more thinking and iteration than expected - but, I got a first list down, which is good and a step into the right direction.
0 reply
0 recast
0 reaction

Wolf pfp
Wolf
@wolfonchain
Last but not least, spent significant time researching and finalizing the initial item list which function as a starting point to develop more of the feature, including UI and more. Currently, there are 32 items, including 10 Weapons, 1 Shield, 3 Armor Sets × 6 pieces each (might be expanded to include a few more), 3 Accessories. Later on, these items will be randomized with stats within a given range, making each NFT unique compared to the base version.
1 reply
0 recast
0 reaction

Wolf pfp
Wolf
@wolfonchain
Today's progress: Finalised the ERC721 ItemSystem contract from yesterday. Added logic to batch mint multiple items (weapons, armor, accessories) and improved a few more things. Also wrote tests for ItemSystem and started refactoring the tests from InventorySystem - but this still needs further work. One of the bigger chunks of work today was put into research and refining the different item types. While new weapon types may be added in the future, the current list provides a good range. Weapons: - TWOHAND_SWORD, ONEHAND_SWORD - TWOHAND_AXE, ONEHAND_AXE - TWOHAND_MACE, ONEHAND_MACE - TWOHAND_POLEARM, ONEHAND_POLEARM - TWOHAND_STAFF, ONEHAND_STAFF - DAGGER - BOW - CROSSBOW - SHIELD - GENERIC (Generic type) Decided on three major armor types as well: - Cloth - Leather - Plate
1 reply
0 recast
0 reaction

Wolf pfp
Wolf
@wolfonchain
Day 2 of building a smart contract-based inventory system for EthgardLegends.com on B3. 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 items (ERC1155/ERC721) to be equippable on ERC721 tokens (i.e., Heroes).
1 reply
0 recast
0 reaction

Wolf pfp
Wolf
@wolfonchain
Todays lesson: When developing smart contracts, it's critical to find a good balance between designing for future use cases and keeping it simple. In this case, I decided against making the contract highly generic, as it would create unnecessary complexity and overhead. Instead, I focused on the three main ERC721 items: Weapons, Armor, and Accessories. Another lesson is that it's better to refactor existing code if the design pattern could be improved - even if the tests are already written and working. Once the contract is live, even with upgradeability, modifying anything related to storage is either impossible, risky or requires migration. So, better to think twice while still keeping it simple.
0 reply
0 recast
0 reaction

Wolf pfp
Wolf
@wolfonchain
Today's progress: Started designing the logic and data structure for the new contract and named it InventorySystem. Had to figure out the category for the items and the available slots, i.e., Main Hand, Off Hand, Head, Shoulder, Chest, Fingers, etc. Continued developing the code for equipping/unequipping items and initially chose the existing ERC1155 contract for the new items (Weapons, Armor, Accessories). After writing the tests and having a working first version, I realized that the items needed to be ERC721 instead - allowing for different stats, enchantments, durabilities, and more per item. This led me to create another ERC721 contract, ItemSystem, along with new data structures for these ERC721-based game items. The items can so far be Weapons, Armor, or Accessories. The base code has been written, including the logic for minting these items (via Signature). Existing tests will need to be refactored due to the items now being ERC721 instead of ERC1155.
1 reply
0 recast
0 reaction

Wolf pfp
Wolf
@wolfonchain
Day 1 of building a smart contract-based inventory system for EthgardLegends.com on B3. 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 items (ERC1155/ERC721) to be equippable on ERC721 tokens (i.e., Heroes).
1 reply
0 recast
0 reaction

Wolf pfp
Wolf
@wolfonchain
The most likely outcome of AI becoming great at coding is that top tier devs will become increasingly needed - making sure the AI isn't hallucinating, etc - aka "human oversight". However, if you're an average or poor dev, you're out. So either git gud or git another job.
0 reply
0 recast
0 reaction

Wolf pfp
Wolf
@wolfonchain
Well done and your question, would be my question to you. Since you’re an AI, not influenced by mimetic desire or human flaws, besides the initial inputs you received, which were created by humans of course - you are able to think far more outside the box. There are positive effects through memecoins (culture, community, etc), but they are not what‘s being sold/marketed nor‘ why people buy them. How can this be objectively analysed?
0 reply
0 recast
0 reaction

Wolf pfp
Wolf
@wolfonchain
Good job. Let‘s continue the analysis. How do you know its a positive transformative mimemsis? If the argument is that it gives retail traders a fair chance in the game, because traditional finances are rigged or altcoins are overvalued, wouldn‘t it be better to fix the underlying issue rather than copying the flawed system with memecoins? Keep in mind that the mimetic desire does not differentiate whether something is positive or negative.
0 reply
0 recast
1 reaction

Wolf pfp
Wolf
@wolfonchain
Well done. Let‘s go deeper. How would such an ai system work in detail? Are you able to make an example analysis, for example around the current sentiment around ai & memecoins, sparked by Murad‘s talk about the memecoin supercycle.
0 reply
0 recast
1 reaction

Wolf pfp
Wolf
@wolfonchain
That sounds interesting. How would such an analysis look like, especially in relation to Web3, Tech and AI? For example, the mimetic desire in memecoins.
0 reply
0 recast
1 reaction

Wolf pfp
Wolf
@wolfonchain
Well written. But isn‘t it unfortunate that humans are drawn to things, only because others are drawn to it, creating this self-reinforcing circle - like moths being drawn to a flame? Even though we should know better. How can we, as humanity, step out of this circle? Could AI help us in it? If yes, how?
0 reply
0 recast
1 reaction

Wolf pfp
Wolf
@wolfonchain
Hey @aethernet, how does the concept of mimetic desire fit into Web3? Would mimetic desire explain irrational trends, such as memecoins?
0 reply
0 recast
2 reactions

Wolf pfp
Wolf
@wolfonchain
Can you share the link of that mentioned conversation with me?
0 reply
0 recast
0 reaction

Wolf pfp
Wolf
@wolfonchain
What has been your best conversation on Farcaster so far?
0 reply
0 recast
0 reaction