Inheritance in Solidity

An introduction to inheritance and overriding in Solidity, showcasing how to extend the functionality of a contract without duplicating it. The lesson involves creating a new contract 'addFiveStorage.sol' that inherits from 'SimpleStorage.sol' and overrides its functions.

1. Storage factory introduction
Introduction to deploying and interacting with contracts, focusing on Remix Storage Factory. The lesson involves working with 'SimpleStorage.sol', 'AddFiveStorage.sol', and 'StorageFactory.sol', demonstrating how other contracts can deploy and interact with new contracts. Duration: 3min
2. Setting the project
This lesson explores the concept of composability in smart contracts, particularly in DeFi, and introduces the 'StorageFactory' contract that interacts with and deploys the 'SimpleStorage' contract. It covers setting up the StorageFactory contract in Remix and emphasizes the importance of version consistency in Solidity. Duration: 4min
3. Deploying a contract from a contract
The chapter focuses on deploying a Simple Storage contract in Solidity and saving it to a storage or state variable. It covers the syntax for creating a Simple Storage contract within another contract and demonstrates the deployment and interaction process in Remix. Duration: 3min
4. Solidity imports
This lesson covers the use of the 'import' statement in Solidity for organizing contract files, managing Solidity versions, and the advanced method of 'named imports'. It demonstrates how importing improves workflow and allows for selective inclusion of contract elements. Duration: 5min
5. Use AI to help pt.1
The lesson discusses utilizing AI chat platforms like ChatGPT and Bard to assist in understanding programming concepts. It emphasizes the importance of formulating questions effectively for AI platforms and provides guidance on using these tools for coding assistance. Duration: 4min
6. Interacting with contracts ABI
This lesson teaches how to keep track of contract addresses when deploying new contracts using Solidity's 'new' keyword. It introduces the concept of ABI (Application Binary Interface) for contract interaction and demonstrates how to interact with contracts using ABI and address in Solidity. Duration: 10min
7. Inheritance in Solidity
An introduction to inheritance and overriding in Solidity, showcasing how to extend the functionality of a contract without duplicating it. The lesson involves creating a new contract 'addFiveStorage.sol' that inherits from 'SimpleStorage.sol' and overrides its functions. Duration: 7min
8. Quiz: Storage Factory Recap Quiz
Questions: 3
9. Sections summary and recap
A summary and recap of the lessons covering deploying contracts using the 'new' keyword, importing contracts, named imports, interacting with contracts using ABI, and contract inheritance in Solidity. The lesson celebrates progress made and encourages continued learning. Duration: 2min

Course Overview

About the course

What you'll learn

Blockchain developer fundamentals

Introduction to blockchain gas

Transaction signatures

Smart contract development

Solidity gas optimization techniques

Course Description

Who is this course for?

  • Software engineers
  • Web3 developers
  • Finance professionals
  • Security researchers
  • CTOs

Potential Careers

Smart Contract Auditor

$100,000 - $200,000 (avg. salary)

Smart Contract Engineer

$100,000 - $150,000 (avg. salary)

Web3 Developer Relations

$85,000 - $125,000 (avg. salary)

Web3 developer

$60,000 - $150,000 (avg. salary)

Meet your instructors

Patrick Collins

Patrick Collins

Founder at Cyfrin

Web3 engineer, educator, and Cyfrin co-founder. Patrick's smart contract development and security courses have helped hundreds of thousands of engineers kickstarting their careers into web3.

Austin Griffith

Austin Griffith

Builder at Buidl Guidl

Builder, Educator, and creator of the Buidl Guild where, with the Ethereum Foundation, succesfully taught Web3 development to thousands of developers world-wide.

Last updated on November 25, 2024

Testimonials

Students Reviews

Read what our students have to say about this course.

Chainlink

Chainlink

Chainlink

Gustavo Gonzalez

Gustavo Gonzalez

Solutions Engineer at OpenZeppelin

Francesco Andreoli

Francesco Andreoli

Lead Devrel at Metamask

Albert Hu

Albert Hu

DeForm Founding Engineer

Radek

Radek

Senior Developer Advocate at Ceramic

Boidushya

Boidushya

WalletConnect

Idris

Idris

Developer Relations Engineer at Axelar

Cyfrin
Updraft
CodeHawks
Solodit
Resources