DEV Community

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

Posted on

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.

Top comments (0)