DEV Community

Amy's Vue on this
Amy's Vue on this

Posted on

2 1

Web3 Solidity + JavaScript 32 hour course recap #9

timestamps: 3:00:00 - 3:30:30

This is a recap of me making my way through the 32 hour course by Patrick Collins posted on FreeCodeCamp.

Today revolved around learning how to import other contracts into a master contract, and to extend the functionality of contracts with inheritance.

pragma solidity ^0.8.0;

import "./SimpleStorage.sol";

contract ExtraStorage is SimpleStorage{
// overrides the function called 'store'
function store(uint256 _favoriteNumber) public override{
favoriteNumber = _favoriteNumber +/ 5;
}
}

When importing contracts and/or extending them it is important to keep the versioning compatible. So a pragma of 0.7.0 will not be compatible with ^0.8.0

In order to interact with any contract you need two things: contract address, and its ABI (application binary interface). The ABI lets you know what inputs and outputs the contract has.

Things that I learned: EVM stands for Ethereum Virtual Machine, which is what the Solidity code compiles down to. Polygon, Avalanche, and Fantom are all EVM compatible. Solona uses Rust.

Image of Datadog

The Essential Toolkit for Front-end Developers

Take a user-centric approach to front-end monitoring that evolves alongside increasingly complex frameworks and single-page applications.

Get The Kit

Top comments (0)

Billboard image

Create up to 10 Postgres Databases on Neon's free plan.

If you're starting a new project, Neon has got your databases covered. No credit cards. No trials. No getting in your way.

Try Neon for Free →

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay