SOLIDITY β Contract that Creates other Contracts & Try/Catch β
Topics: Contract that Creates other Contracts & Try/Catch + example code
Welcome to all future blockchain devs π¨π½βπ» to my channel! Solidity is the backbone of the Ethereum Ecosystem, thus, definitely worth learning. Blockchain is a technology that is here to stay. I am really curious which innovations will emerge in that context within the next 10 years. Today we are talking about how to create contracts with a contract as well as the try/catch functionality. All the information was derived from solidity-by-example β Big shout out to the team. Letβs straight jump into the world of Solidity β¬οΈ
A Contract that Creates other Contracts β‘οΈ
By using the new keyword you can create contracts. Since Solidity version 0.8.0 the new keyword supports the create2 feature by specifying salt options.
In order to manifest all the functionalities of Solidity, you should try out the example codes in your favorite IDE. A good one to start is Ethereum Remix IDE π
Try & Catch β‘οΈ
Try/Catch can only catch the errors from external function calls as well as contract creation.
Here is an example code you should try out in the IDE β¬οΈ
Thatβs it for today. Have fun trying out the example codes by solidity-by-example. Try to modify the code and think about in which real-life example you could use the functionality. Maybe you have a current project where implementation would make sense and improve your code! Have fun π
*Thanks for reading this article! If you want to support me you can do it as follows:
- Give me a follow here, on Medium, on Twitter, Instagram, TikTok or YouTube.
- Like the article.
- Leave a comment on the article.
I really appreciate every kind of support! Every interaction you are doing with the content will help me grow and deliver better content with time. π
Thank you, VEGXCODES*
Resources β‘οΈ
Link 1: https://solidity-by-example.org/new-contract
Link 2: https://solidity-by-example.org/try-catch
Note: This article also appears in a similar form on Medium and Twitter π