Odak modu
Code from video: https://solidity-by-example.org/inheritance/
You can access the video content in Turkish prepared by İTÜ Blockchain here: https://www.youtube.com/watch?v=KSrhlrHlti4&list=PLby2HXktGwN4Cof_6a8YwlMrboX8-hs73&index=15&t=2s
When creating a smart contract, we can take advantage of all the functions of another smart contract by using the inheritance feature. The inclusion of contracts within each other allows writing of clean and understandable code, as in library usage. When a contract inherits from other contracts, only a single contract is created on the blockchain, and the code from all the base contracts is compiled into the created contract. Solidity is a programming language that supports multiple inheritances.
"is, virtual, override" keywords used for inheritance:
Contracts can inherit other contracts using the ‘is’ keyword. (example: “contract B is A {}”)
virtual: The qualifier that indicates that the function can be overridden by a subcontract.
override: The qualifier that tells us to override and redefine functions marked with virtual in a base contract.
The general inheritance system is very similar to Python’s, especially concerning multiple inheritance, but there are also some differences.
Resources:
You can find detailed further information from Solidity Official documentation (in English): https://docs.soliditylang.org/en/v0.8.15/contracts.html#inheritance
https://github.com/itublockchain/web3-bootcamp/tree/master/1x12_Inheritance
Sektörde en çok aranan yazılım becerilerini kazan
Yapay zeka desteği, birebir mentörlük saatleri, canlı dersler ve senin için özel hazırlanmış içeriklerle eksiklerini tamamla, düzenli geri bildirimler al ve öğrenme sürecini en verimli hale getir.
Yunus Emre Kabakcı
Patika+ mezunuPatika+ Fullstack Web Development Bootcamp mezunumuz Yunus Emre,
3 ay içinde Katar’dan aldığı teklif ile, global bir şirket olan Pavo Group’da işe başladı!
“İçerik zenginliği, mentor desteği, ileriye dönük bir network sağlaması ve dünyada en çok tercih edilen frameworkler üzerinden bir eğitim veriyor olması Patika+’ı tercih etmemin temel sebepleri oldu!“
Yorum yapabilmek için derse kayıt olmalısın!