July 15, 2023
With so many pre-built solutions, why did I decide to build my own smart contract?
I've recently launched my first smart contract on the Ethereum blockchain, allowing me to offer my artworks as NFTs. You can find my Editions contract here.
There are multiple options available for creating your own smart contract, through services like Manifold and ThirdWeb. However, I decided to develop my own. So, why did I make this choice?
... do the other things, not because they are easy, but because they are hard.
John F. Kennedy - September 12, 1962
For me, it is crucial to have complete control and ownership over everything I work on. By building my own smart contracts, I have the opportunity to fully customise them to fit my specific ideas and needs, particularly with how it integrates into my website.
One advantage of developing my own contract is the flexibility it offers in terms of functionality. I really wanted a contract that allowed me to set the edition size and pricing for each token created. Standard ERC1155 contracts usually allow these parameters for all tokens but not individually.
Writing my own contract also enabled me to attach licensing information to the contract specifying what rights a holder has to the tokens attached. In the case of my Editions contract all users have Personal usage rights to any tokens they own.
I was also able to implement the latest royalty functions to ensure that OpenSea sends the pre-set commission to me if a token is sold on the secondary market. Quite a hot topic at the moment but when it comes to artwork I do believe that the artist is due a small percentage of third party sales. I am currently looking into my own royalty standards where sellers are only charged if they sell for a profit.
I found that prebuilt contracts often incurred high gas costs for users. To address this, I implemented several optimisations in my own smart contract, resulting in a significant reduction in gas required for minting, I found that my contract was nearly 50% more efficient than others that I checked.
For instance, let's consider the mint functions for both ERC1155 contracts:
Assuming a gas price of 30 Gwei and ETHs price being at $2000, the cost of minting at these gas levels would be as follows:
As you can see, by implementing some gas optimizations, I was able to significantly reduce the gas costs for users, offering them a more cost effective solution when minting NFTs through my contract.
These optimizations not only contribute to a more streamlined and efficient user experience but also make the process more accessible and affordable for individuals looking to acquire my artworks as NFTs.
My quest for learning and self-improvement is a driving force behind my passion for website and smart contract development. I find great joy from continuously expanding my knowledge and building upon my skill set. It might sound weird to some, but I genuinely enjoy spending hours dedicated to optimising my contracts.
Technology is always evolving, so I always need to be continuously honing my skills and staying abreast of the latest developments. I try to ensure that the websites and smart contracts I create are of the highest quality and provide the best possible experience and more importantly security for those who interact with them.
As someone who learns by doing, practical exercises like this are important for my continual growth and development both personally and professionally.
In essence, building my own smart contract on the Ethereum blockchain has empowered me to take full control and ownership of my artworks as NFTs. The adaptability of my contract, allowing me to set individual edition sizes and pricing, adds a personal touch to each token and enhances the collector's experience.
Through diligent gas optimization, I have significantly reduced costs for users, making the minting process more accessible and affordable. I strive to navigate the ever-evolving world of technology, pushing boundaries and embracing innovation.
Together, let's embark on this exciting journey, harnessing the potential of blockchain to revolutionise the way we appreciate and acquire art.