This project is my first attempt at implementing the ERC-721 non-fungible token standard. I worked on this for about 3-4 days. The only prior experience with blockchain devleopment I have had up until this point was MislavCoin. My goal was to try to implement the aforementioned standard without looking at any existing implementation. I’m publishing what I’ve coded up until the point where I got stuck and where I would take a look at an existing implementation.
The main thing I realized while trying to implement ERC-721 from scratch was that I ought to become more familiar with Solidity design patterns. Namely, I’ve used for loops for iterating over arrays in some of the methods, which is an anti-pattern in smart contracts due to gas costs.
After looking at OpenZeppelin’s ERC-721 implementation, I noticed that I could have done the following things better:
- put repeated checks into their own methods
- used hooks
You can find the Github repo here.
Subscribe to my newsletter to keep abreast of the interesting things I'm doing. I will send you the newsletter only when there is something interesting. This means 0% spam, 100% interesting content.