Network
Launch Date
Consensus
Note
Sepolia
Oct 2021
PoW
Like-for-like representation of Ethereum
Görli
Jan 2019
PoA
Proof-of-Authority
Kiln
Mar 2022
PoS
Post-Merge (for ETH2), shadow fork of the mainnet
Kintsugi
Dec 2021
PoS
DEPRECATED, use Kiln; post-Merge (for ETH2)
Ropsten
Nov 2016
PoW
DEPRECATED, use Sepolia; the Merge to happen on Jun 8, 2022
Rinkeby
Apr 2017
PoA
DEPRECATED, use Görli and Görli Faucet
Kovan
Mar 2017
PoA
DEPRECATED, use Sepolia or Görli
List of active and deprecated Ethereum testnets, including Kintsugi.
Features
Optimistic rollup 
ZK-rollup 
Proof
Uses fraud proofs to prove transaction validity. 
Uses validity (zero-knowledge) proofs to prove transaction validity. 
Capital efficiency
Requires waiting through a 1-week delay (dispute period) before withdrawing funds. 
Users can withdraw funds immediately because validity proofs provide incontrovertible evidence of the authenticity of off-chain transactions. 
Data compression
Publishes full transaction data as calldata to Ethereum Mainnet, which increases rollup costs. 
Doesn't need to publish transaction data on Ethereum because ZK-SNARKs and ZK-STARKs already guarantee the accuracy of the rollup state. 
EVM compatibility
Uses a simulation of the Ethereum Virtual Machine (EVM), which allows it to run arbitrary logic and support smart contracts. 
Doesn't widely support EVM computation, although a few EVM-compatible ZK-rollups have appeared. 
Rollup costs
Reduces costs since it publishes minimal data on Ethereum and doesn't have to post proofs for transactions, except in special circumstances. 
Faces higher overhead from costs involved in generating and verifying proofs for every transaction block. ZK proofs require specialized, expensive hardware to create and have high on-chain verification costs. 
Trust assumptions
Doesn't require a trusted setup. 
Requires a trusted setup to work. 
Liveness requirements
Verifiers are needed to keep tabs on the actual rollup state and the one referenced in the state root to detect fraud. 
Users don't need someone to watch the L2 chain to detect fraud. 
Security properties 
Relies on cryptoeconomic incentives to assure users of rollup security. 
Relies on cryptographic guarantees for security. 
Start building
on Alchemy.
Sign up for free
Start building on Optimism.
Sign up for free
Start building on Arbitrum.
Sign up for free
Start building on Ethereum.
Sign up for free
Start building on Polygon.
Sign up for free
Start building on Starknet.
Sign up for free
Start building on Flow.
Sign up for free
kiln faucet
Get free Kiln ETH.
Start building today
Goerli faucet
Get free Goerli ETH.
Start building today
mumbai faucet
Get free Mumbai Matic.
Start building today
rinkeby faucet
Get free Rinkeby
ETH.
Start building today
Start building on Ethereum.
Get started for free
Start building on Ethereum.
Get started for free
Start building on Flow.
Get started for free
Start building on Polygon.
Get started for free
Start building on Starknet.
Get started for free
Start building on Optimism.
Get started for free
Start building on Solana.
Get started for free
Start building on Solana.
Sign up for beta access
Start building on Solana.
Join the waitlist
Arbitrum logo
Start building on Arbitrum.
Get started for free
Learn
Solidity at
Alchemy
University
Get started today
curl 
https://release.solana.com/v1.10.32/solana-install-init-x86_64-pc-windows-msvc.exe 
--output 
C:\solana-install-tmp\solana-install-init.exe 
--create-dirs
Learn Solidity
HOW TO LEARN SOLIDITY

The Best Way to Learn Solidity for Free (2022)

Go from Beginner to Gigabrain Solidity Developer
Last Updated:
October 4, 2022
Table of Contents
Table of Contents
Table of Contents

{{learn-solidity}}

Solidity is an object-oriented, high-level language for programming smart contracts. Learning Solidity will allow you to create smart contracts and decentralized applications (dApps). 

This article covers the most common methods to learn Solidity and introduces important Solidity concepts that students need to learn to become an Ethereum developer.

Why is learning Solidity important?

Solidity, the programming language for writing smart contracts on Ethereum and EVM compatible blockchains, is one of the most important skills for blockchain developers. As the ecosystem around Ethereum and other smart contract platforms grows, so does the demand for Solidity developers.

At the time of writing, the average salary for a remote Solidity developer is $145,000 per year, and experienced developers can earn upwards of $500,000 including employee stock options and token-based incentives. Even in bear markets, there are 1000s of Solidity job postings seeking qualified candidates.

Not only can learning Solidity provide tremendous financial opportunities, but it also allows you to build amazing dApps that can have a huge impact on the world. In fact, Ethereum alone has close to 3,000 dApps serving a range of goals from financial inclusion to sustainable energy.

Learn Solidity with a Bootcamp

If you want to learn Solidity and other blockchain development skills in a structured, immersive environment, a Solidity bootcamp might be the right option for you. Blockchain bootcamps provide intensive, hands-on training to help you become a job-ready blockchain developer.

After Alchemy acquired ChainShot, Alchemy redesigned ChainShot's 7-week, $3,000 Ethereum Developer Bootcamp, and is offering it to the public for FREE under Alchemy University. To learn Solidity with expert teachers and alongside motivated peers, secure your place in line for Alchemy University's Solidity bootcamp.

If developers are new to development in general, Alchemy University's 3-week JavaScript crash course is a great prerequisite before starting an Ethereum bootcamp.

Learn Solidity with Tutorials

If you're a self-starter and want to learn at your own pace, tutorials are a great way to learn Solidity. There are many high-quality Solidity tutorials available online, ranging from beginner to advanced levels.

The official Ethereum developer resources include 53 tutorials tagged "Solidity," covering everything from the basics of smart contracts to more advanced topics like gas optimization and secure signing.

Learn Solidity with Online Courses

Online courses are a great way to learn Solidity if you want more structure and guidance than tutorials provide. There are many high-quality Solidity courses available, both free and paid from web3 startups and web2 platforms like Udemy.

While tutorials are self-paced, online courses often have set lessons and deadlines, providing time-bound motivation for learners to stay on track. In addition, courses often include quizzes and other assignments to test your knowledge as you progress.

Important Solidity Concepts to Learn

Once you've chosen your learning method, it's time to start learning how to code in Solidity. A number of core Solidity concepts are important to understand to write effective code.

Solidity ABI

The Application Binary Interface (ABI) is a set of rules that allows two different pieces of software to interact with each other. In the context of Solidity, the ABI allows smart contracts to interact with each other, as well as with external software like wallets.

The ABI allows you to write code that can interact with any contract, regardless of whether you have the source code or not. This is possible because the ABI includes all the information needed to encode and decode data that is passed between contracts.

Smart Contracts

A smart contract is a piece of code that runs on the Ethereum blockchain and performs certain actions when a set of conditions are met. Smart contracts can be used to create digital tokens, decentralized applications (dApps), and more.

A common smart contract use case is creating an ERC20 token, which can be done in just a few lines of code. More complex smart contracts include token swaps, yield farming, and synthetic assets. These contracts are compiled using a Solidity compiler, which outputs bytecode used to deploy the contract.

ERC20 Tokens

ERC20 tokens are a type of digital asset that runs on the Ethereum blockchain. They are often used to represent real-world assets, such as commodities or fiat currencies.

ERC20 tokens are the most common type of digital asset on Ethereum. Since ERC20 tokens are also one of the easiest types of contracts to write, learning how to creating them is an important skill to master.

Contract Interface

An interface is a way to specify what functions a contract must have. Interfaces allow you to create contracts that can be easily reused and extended. For example, you could create an interface for a token contract, and then any contract that implements that interface can be used as a token.

Inheritance

Inheritance is a way to reuse code in Solidity. Inheritance allows you to create "child" contracts that inherit all the code from a "parent" contract. This lets developers avoid duplicating code and makes smart contract maintenance much easier.

Inheritance is an important concept in object-oriented programming, and it's one of the things that makes Solidity so powerful. Learning how to to create standardized contracts that can be easily extended and modified is an important Solidity lesson to master.

Functions

As with any programming language, functions are a key part of Solidity. Solidity functions are pieces of code that receive inputs, performs some action, and returns an output. 

Functions can be written into Solidity smart contracts to perform all sorts of actions, from sending tokens to storing data. A collection of functions intended for reuse is called a library.

A basic principle in coding is called the "D.R.Y. principle," which stands for "Don't Repeat Yourself." This principle states that developers should never write the same piece of code twice. Instead, developers should write a function once, and then call that function whenever you need to perform that action.

Function Visibility

One important thing to note about Solidity functions is that they have visibility settings. Visibility determines who can see and execute the function. There are four visibility levels in Solidity: public, external, internal, and private.

  • Public functions can be seen and executed by anyone.
  • External functions can be seen by anyone but can only be executed by other contracts.
  • Internal functions can only be seen and executed by other functions within the same contract.
  • Private functions can only be seen and executed by the contract itself.

Call Function

The call function allows you to execute code in another contract. This is how contracts interact with each other on Ethereum.

The call function allows you to write code that can interact with any contract, regardless of whether you have the source code or not. This is possible because the ABI includes all the information needed to encode and decode data that is being passed between contracts.

Delegatecall Function

The delegatecall function is similar to the call method, but with one important difference; it executes the code in the context of the caller. This means that any storage changes made by the called contract will be made to the caller's storage.

The delegatecall function allows you to write contracts that can be reused by other contracts. For example, you could write a contract that implements an interface, and then other contracts can delegatecall that contract to use the interface.

Modifiers

Modifiers are like functions, but with some important differences. First, modifiers can only be used on functions. Second, modifiers are called before the function is executed. An example of a modifier is payable, which allows a function to receive Ether into the contract.

Modifiers allow you to change the behavior of a function without touching the actual code. For instance, a modifier could check if a user has enough balance before executing a function, or to add an event that is triggered when the function is called.

Arrays

Arrays are linear data structures that store a fixed-size of elements of the same data types which are stored in contiguous and adjacent memory locations. An array can be both of fixed or dynamic size. The size of dynamic arrays are not predefined when they are declared, in contrast to fixed arrays which have a predefined size.

If developers need to iterate over a group of data (e.g. using a loop) then use an array. If there’s no need to iterate over a set of data, and instead developer can retrieve values based on a known key, then consider using mappings.

Structs

A struct is a way to store data in a Solidity contract. Structs are similar to an array, but each element can have a different type. Structs are useful for creating more complicated data types that have multiple properties.

Mappings

A mapping is a way to store data in a Solidity contract. Mappings are similar to arrays, but the keys can be any type and not just integers. This feature makes mappings versatile and powerful. Mappings allow you to store data in a contract in a way that is flexible and easy to use. 

Events

Events are a way to trigger code execution when certain conditions are met. For example, developers can write an event that is triggered when a user buys a token, or when a transaction is confirmed on the blockchain.

Solidity events allow developers to write code that is executed in response to real-world events. This is how many dApps are able to interact with the real world, for example by sending an email or SMS when a condition is met.

Require (Error Handling)

The "require" keyword is one of three special functions: require, assert, and revert. Require checks if a condition is true, and if not, it will revert the transaction and return an error message.

Using require allows you to prevent errors from happening in your contract. For example, you could use require to check that a user has enough balance to make a purchase, or that an address is valid before sending a transaction.

Upgradeable Smart Contracts

Upgradeable smart contracts are a type of contract that can be upgraded without the need to redeploy the contract. Upgradeable smart contracts allow you to make changes to a contract after it has been deployed, without effecting any of the data or code that is already on the blockchain.

Proxy Contracts

A proxy contract is a type of contract that allows another contract to execute its code. Solidity proxy contracts are useful for cases where you want to upgrade a contract but don't want to redeploy it.

Proxy contracts are also useful when developers want to execute a contract's code on a different blockchain. For example, you could use a proxy contract to execute a Solidity contract on an Ethereum testnet.

Multisig Contracts

A multisig contract is a type of contract that requires more than one signature to execute its code. Solidity multisig contracts are useful when developers want to require multiple people to approve a transaction before it is executed.

Multisig contracts are also useful for cases where developers want to limit the amount of money that can be spent in a certain period of time. For example, you could use a multisig contract to require two signatures for any transaction over $1,000.

Reentrancy Attacks

Reentrancy attacks are a type of attack that can occur in Solidity contracts when a contract calls another contract, and then the second contract calls back into the first contract or another untrusted contract, typically before the first contract has finished executing.

Reentrancy attacks can be used to exploit vulnerabilities in contracts. For example, an attacker could use a reentrancy attack to drain all the Ether from a contract.

The Best Way to Learn Solidity

No matter what your goals are, there is a way for you to learn Solidity that fits your needs. If you're looking for a quick and easy way to get started, tutorials are a great option. You can also check out our introduction to Solidity. If you want more structure and guidance, online courses might be a better fit. And if you're looking for an immersive, hands-on experience, a bootcamp could be the right choice.

Once you've chosen your learning method, there are a number of important concepts to ensure you get down, including smart contracts, functions, events, and more. By understanding these concepts, you'll be well on your way to becoming a proficient Solidity developer.

ALCHEMY SUPERNODE - ETHEREUM NODE API

Scale to any size, without any errors

Alchemy Supernode finally makes it possible to scale blockchain applications without all the headaches. Plus, our legendary support will guide you every step of the way.

Get started for free
Supernode footer
Learn Solidity
HOW TO LEARN SOLIDITY

The Best Way to Learn Solidity for Free (2022)

Go from Beginner to Gigabrain Solidity Developer
Last Updated:
October 4, 2022
Don't miss an update
Sign up for our newsletter to get alpha, key insights, and killer resources.
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.
Table of Contents
Table of Contents

{{learn-solidity}}

Solidity is an object-oriented, high-level language for programming smart contracts. Learning Solidity will allow you to create smart contracts and decentralized applications (dApps). 

This article covers the most common methods to learn Solidity and introduces important Solidity concepts that students need to learn to become an Ethereum developer.

Why is learning Solidity important?

Solidity, the programming language for writing smart contracts on Ethereum and EVM compatible blockchains, is one of the most important skills for blockchain developers. As the ecosystem around Ethereum and other smart contract platforms grows, so does the demand for Solidity developers.

At the time of writing, the average salary for a remote Solidity developer is $145,000 per year, and experienced developers can earn upwards of $500,000 including employee stock options and token-based incentives. Even in bear markets, there are 1000s of Solidity job postings seeking qualified candidates.

Not only can learning Solidity provide tremendous financial opportunities, but it also allows you to build amazing dApps that can have a huge impact on the world. In fact, Ethereum alone has close to 3,000 dApps serving a range of goals from financial inclusion to sustainable energy.

Learn Solidity with a Bootcamp

If you want to learn Solidity and other blockchain development skills in a structured, immersive environment, a Solidity bootcamp might be the right option for you. Blockchain bootcamps provide intensive, hands-on training to help you become a job-ready blockchain developer.

After Alchemy acquired ChainShot, Alchemy redesigned ChainShot's 7-week, $3,000 Ethereum Developer Bootcamp, and is offering it to the public for FREE under Alchemy University. To learn Solidity with expert teachers and alongside motivated peers, secure your place in line for Alchemy University's Solidity bootcamp.

If developers are new to development in general, Alchemy University's 3-week JavaScript crash course is a great prerequisite before starting an Ethereum bootcamp.

Learn Solidity with Tutorials

If you're a self-starter and want to learn at your own pace, tutorials are a great way to learn Solidity. There are many high-quality Solidity tutorials available online, ranging from beginner to advanced levels.

The official Ethereum developer resources include 53 tutorials tagged "Solidity," covering everything from the basics of smart contracts to more advanced topics like gas optimization and secure signing.

Learn Solidity with Online Courses

Online courses are a great way to learn Solidity if you want more structure and guidance than tutorials provide. There are many high-quality Solidity courses available, both free and paid from web3 startups and web2 platforms like Udemy.

While tutorials are self-paced, online courses often have set lessons and deadlines, providing time-bound motivation for learners to stay on track. In addition, courses often include quizzes and other assignments to test your knowledge as you progress.

Important Solidity Concepts to Learn

Once you've chosen your learning method, it's time to start learning how to code in Solidity. A number of core Solidity concepts are important to understand to write effective code.

Solidity ABI

The Application Binary Interface (ABI) is a set of rules that allows two different pieces of software to interact with each other. In the context of Solidity, the ABI allows smart contracts to interact with each other, as well as with external software like wallets.

The ABI allows you to write code that can interact with any contract, regardless of whether you have the source code or not. This is possible because the ABI includes all the information needed to encode and decode data that is passed between contracts.

Smart Contracts

A smart contract is a piece of code that runs on the Ethereum blockchain and performs certain actions when a set of conditions are met. Smart contracts can be used to create digital tokens, decentralized applications (dApps), and more.

A common smart contract use case is creating an ERC20 token, which can be done in just a few lines of code. More complex smart contracts include token swaps, yield farming, and synthetic assets. These contracts are compiled using a Solidity compiler, which outputs bytecode used to deploy the contract.

ERC20 Tokens

ERC20 tokens are a type of digital asset that runs on the Ethereum blockchain. They are often used to represent real-world assets, such as commodities or fiat currencies.

ERC20 tokens are the most common type of digital asset on Ethereum. Since ERC20 tokens are also one of the easiest types of contracts to write, learning how to creating them is an important skill to master.

Contract Interface

An interface is a way to specify what functions a contract must have. Interfaces allow you to create contracts that can be easily reused and extended. For example, you could create an interface for a token contract, and then any contract that implements that interface can be used as a token.

Inheritance

Inheritance is a way to reuse code in Solidity. Inheritance allows you to create "child" contracts that inherit all the code from a "parent" contract. This lets developers avoid duplicating code and makes smart contract maintenance much easier.

Inheritance is an important concept in object-oriented programming, and it's one of the things that makes Solidity so powerful. Learning how to to create standardized contracts that can be easily extended and modified is an important Solidity lesson to master.

Functions

As with any programming language, functions are a key part of Solidity. Solidity functions are pieces of code that receive inputs, performs some action, and returns an output. 

Functions can be written into Solidity smart contracts to perform all sorts of actions, from sending tokens to storing data. A collection of functions intended for reuse is called a library.

A basic principle in coding is called the "D.R.Y. principle," which stands for "Don't Repeat Yourself." This principle states that developers should never write the same piece of code twice. Instead, developers should write a function once, and then call that function whenever you need to perform that action.

Function Visibility

One important thing to note about Solidity functions is that they have visibility settings. Visibility determines who can see and execute the function. There are four visibility levels in Solidity: public, external, internal, and private.

  • Public functions can be seen and executed by anyone.
  • External functions can be seen by anyone but can only be executed by other contracts.
  • Internal functions can only be seen and executed by other functions within the same contract.
  • Private functions can only be seen and executed by the contract itself.

Call Function

The call function allows you to execute code in another contract. This is how contracts interact with each other on Ethereum.

The call function allows you to write code that can interact with any contract, regardless of whether you have the source code or not. This is possible because the ABI includes all the information needed to encode and decode data that is being passed between contracts.

Delegatecall Function

The delegatecall function is similar to the call method, but with one important difference; it executes the code in the context of the caller. This means that any storage changes made by the called contract will be made to the caller's storage.

The delegatecall function allows you to write contracts that can be reused by other contracts. For example, you could write a contract that implements an interface, and then other contracts can delegatecall that contract to use the interface.

Modifiers

Modifiers are like functions, but with some important differences. First, modifiers can only be used on functions. Second, modifiers are called before the function is executed. An example of a modifier is payable, which allows a function to receive Ether into the contract.

Modifiers allow you to change the behavior of a function without touching the actual code. For instance, a modifier could check if a user has enough balance before executing a function, or to add an event that is triggered when the function is called.

Arrays

Arrays are linear data structures that store a fixed-size of elements of the same data types which are stored in contiguous and adjacent memory locations. An array can be both of fixed or dynamic size. The size of dynamic arrays are not predefined when they are declared, in contrast to fixed arrays which have a predefined size.

If developers need to iterate over a group of data (e.g. using a loop) then use an array. If there’s no need to iterate over a set of data, and instead developer can retrieve values based on a known key, then consider using mappings.

Structs

A struct is a way to store data in a Solidity contract. Structs are similar to an array, but each element can have a different type. Structs are useful for creating more complicated data types that have multiple properties.

Mappings

A mapping is a way to store data in a Solidity contract. Mappings are similar to arrays, but the keys can be any type and not just integers. This feature makes mappings versatile and powerful. Mappings allow you to store data in a contract in a way that is flexible and easy to use. 

Events

Events are a way to trigger code execution when certain conditions are met. For example, developers can write an event that is triggered when a user buys a token, or when a transaction is confirmed on the blockchain.

Solidity events allow developers to write code that is executed in response to real-world events. This is how many dApps are able to interact with the real world, for example by sending an email or SMS when a condition is met.

Require (Error Handling)

The "require" keyword is one of three special functions: require, assert, and revert. Require checks if a condition is true, and if not, it will revert the transaction and return an error message.

Using require allows you to prevent errors from happening in your contract. For example, you could use require to check that a user has enough balance to make a purchase, or that an address is valid before sending a transaction.

Upgradeable Smart Contracts

Upgradeable smart contracts are a type of contract that can be upgraded without the need to redeploy the contract. Upgradeable smart contracts allow you to make changes to a contract after it has been deployed, without effecting any of the data or code that is already on the blockchain.

Proxy Contracts

A proxy contract is a type of contract that allows another contract to execute its code. Solidity proxy contracts are useful for cases where you want to upgrade a contract but don't want to redeploy it.

Proxy contracts are also useful when developers want to execute a contract's code on a different blockchain. For example, you could use a proxy contract to execute a Solidity contract on an Ethereum testnet.

Multisig Contracts

A multisig contract is a type of contract that requires more than one signature to execute its code. Solidity multisig contracts are useful when developers want to require multiple people to approve a transaction before it is executed.

Multisig contracts are also useful for cases where developers want to limit the amount of money that can be spent in a certain period of time. For example, you could use a multisig contract to require two signatures for any transaction over $1,000.

Reentrancy Attacks

Reentrancy attacks are a type of attack that can occur in Solidity contracts when a contract calls another contract, and then the second contract calls back into the first contract or another untrusted contract, typically before the first contract has finished executing.

Reentrancy attacks can be used to exploit vulnerabilities in contracts. For example, an attacker could use a reentrancy attack to drain all the Ether from a contract.

The Best Way to Learn Solidity

No matter what your goals are, there is a way for you to learn Solidity that fits your needs. If you're looking for a quick and easy way to get started, tutorials are a great option. You can also check out our introduction to Solidity. If you want more structure and guidance, online courses might be a better fit. And if you're looking for an immersive, hands-on experience, a bootcamp could be the right choice.

Once you've chosen your learning method, there are a number of important concepts to ensure you get down, including smart contracts, functions, events, and more. By understanding these concepts, you'll be well on your way to becoming a proficient Solidity developer.

Solidity is an object-oriented, high-level language for programming smart contracts. Learning Solidity will allow you to create smart contracts and decentralized applications (dApps). 

This article covers the most common methods to learn Solidity and introduces important Solidity concepts that students need to learn to become an Ethereum developer.

Why is learning Solidity important?

Solidity, the programming language for writing smart contracts on Ethereum and EVM compatible blockchains, is one of the most important skills for blockchain developers. As the ecosystem around Ethereum and other smart contract platforms grows, so does the demand for Solidity developers.

At the time of writing, the average salary for a remote Solidity developer is $145,000 per year, and experienced developers can earn upwards of $500,000 including employee stock options and token-based incentives. Even in bear markets, there are 1000s of Solidity job postings seeking qualified candidates.

Not only can learning Solidity provide tremendous financial opportunities, but it also allows you to build amazing dApps that can have a huge impact on the world. In fact, Ethereum alone has close to 3,000 dApps serving a range of goals from financial inclusion to sustainable energy.

Learn Solidity with a Bootcamp

If you want to learn Solidity and other blockchain development skills in a structured, immersive environment, a Solidity bootcamp might be the right option for you. Blockchain bootcamps provide intensive, hands-on training to help you become a job-ready blockchain developer.

After Alchemy acquired ChainShot, Alchemy redesigned ChainShot's 7-week, $3,000 Ethereum Developer Bootcamp, and is offering it to the public for FREE under Alchemy University. To learn Solidity with expert teachers and alongside motivated peers, secure your place in line for Alchemy University's Solidity bootcamp.

If developers are new to development in general, Alchemy University's 3-week JavaScript crash course is a great prerequisite before starting an Ethereum bootcamp.

Learn Solidity with Tutorials

If you're a self-starter and want to learn at your own pace, tutorials are a great way to learn Solidity. There are many high-quality Solidity tutorials available online, ranging from beginner to advanced levels.

The official Ethereum developer resources include 53 tutorials tagged "Solidity," covering everything from the basics of smart contracts to more advanced topics like gas optimization and secure signing.

Learn Solidity with Online Courses

Online courses are a great way to learn Solidity if you want more structure and guidance than tutorials provide. There are many high-quality Solidity courses available, both free and paid from web3 startups and web2 platforms like Udemy.

While tutorials are self-paced, online courses often have set lessons and deadlines, providing time-bound motivation for learners to stay on track. In addition, courses often include quizzes and other assignments to test your knowledge as you progress.

Important Solidity Concepts to Learn

Once you've chosen your learning method, it's time to start learning how to code in Solidity. A number of core Solidity concepts are important to understand to write effective code.

Solidity ABI

The Application Binary Interface (ABI) is a set of rules that allows two different pieces of software to interact with each other. In the context of Solidity, the ABI allows smart contracts to interact with each other, as well as with external software like wallets.

The ABI allows you to write code that can interact with any contract, regardless of whether you have the source code or not. This is possible because the ABI includes all the information needed to encode and decode data that is passed between contracts.

Smart Contracts

A smart contract is a piece of code that runs on the Ethereum blockchain and performs certain actions when a set of conditions are met. Smart contracts can be used to create digital tokens, decentralized applications (dApps), and more.

A common smart contract use case is creating an ERC20 token, which can be done in just a few lines of code. More complex smart contracts include token swaps, yield farming, and synthetic assets. These contracts are compiled using a Solidity compiler, which outputs bytecode used to deploy the contract.

ERC20 Tokens

ERC20 tokens are a type of digital asset that runs on the Ethereum blockchain. They are often used to represent real-world assets, such as commodities or fiat currencies.

ERC20 tokens are the most common type of digital asset on Ethereum. Since ERC20 tokens are also one of the easiest types of contracts to write, learning how to creating them is an important skill to master.

Contract Interface

An interface is a way to specify what functions a contract must have. Interfaces allow you to create contracts that can be easily reused and extended. For example, you could create an interface for a token contract, and then any contract that implements that interface can be used as a token.

Inheritance

Inheritance is a way to reuse code in Solidity. Inheritance allows you to create "child" contracts that inherit all the code from a "parent" contract. This lets developers avoid duplicating code and makes smart contract maintenance much easier.

Inheritance is an important concept in object-oriented programming, and it's one of the things that makes Solidity so powerful. Learning how to to create standardized contracts that can be easily extended and modified is an important Solidity lesson to master.

Functions

As with any programming language, functions are a key part of Solidity. Solidity functions are pieces of code that receive inputs, performs some action, and returns an output. 

Functions can be written into Solidity smart contracts to perform all sorts of actions, from sending tokens to storing data. A collection of functions intended for reuse is called a library.

A basic principle in coding is called the "D.R.Y. principle," which stands for "Don't Repeat Yourself." This principle states that developers should never write the same piece of code twice. Instead, developers should write a function once, and then call that function whenever you need to perform that action.

Function Visibility

One important thing to note about Solidity functions is that they have visibility settings. Visibility determines who can see and execute the function. There are four visibility levels in Solidity: public, external, internal, and private.

  • Public functions can be seen and executed by anyone.
  • External functions can be seen by anyone but can only be executed by other contracts.
  • Internal functions can only be seen and executed by other functions within the same contract.
  • Private functions can only be seen and executed by the contract itself.

Call Function

The call function allows you to execute code in another contract. This is how contracts interact with each other on Ethereum.

The call function allows you to write code that can interact with any contract, regardless of whether you have the source code or not. This is possible because the ABI includes all the information needed to encode and decode data that is being passed between contracts.

Delegatecall Function

The delegatecall function is similar to the call method, but with one important difference; it executes the code in the context of the caller. This means that any storage changes made by the called contract will be made to the caller's storage.

The delegatecall function allows you to write contracts that can be reused by other contracts. For example, you could write a contract that implements an interface, and then other contracts can delegatecall that contract to use the interface.

Modifiers

Modifiers are like functions, but with some important differences. First, modifiers can only be used on functions. Second, modifiers are called before the function is executed. An example of a modifier is payable, which allows a function to receive Ether into the contract.

Modifiers allow you to change the behavior of a function without touching the actual code. For instance, a modifier could check if a user has enough balance before executing a function, or to add an event that is triggered when the function is called.

Arrays

Arrays are linear data structures that store a fixed-size of elements of the same data types which are stored in contiguous and adjacent memory locations. An array can be both of fixed or dynamic size. The size of dynamic arrays are not predefined when they are declared, in contrast to fixed arrays which have a predefined size.

If developers need to iterate over a group of data (e.g. using a loop) then use an array. If there’s no need to iterate over a set of data, and instead developer can retrieve values based on a known key, then consider using mappings.

Structs

A struct is a way to store data in a Solidity contract. Structs are similar to an array, but each element can have a different type. Structs are useful for creating more complicated data types that have multiple properties.

Mappings

A mapping is a way to store data in a Solidity contract. Mappings are similar to arrays, but the keys can be any type and not just integers. This feature makes mappings versatile and powerful. Mappings allow you to store data in a contract in a way that is flexible and easy to use. 

Events

Events are a way to trigger code execution when certain conditions are met. For example, developers can write an event that is triggered when a user buys a token, or when a transaction is confirmed on the blockchain.

Solidity events allow developers to write code that is executed in response to real-world events. This is how many dApps are able to interact with the real world, for example by sending an email or SMS when a condition is met.

Require (Error Handling)

The "require" keyword is one of three special functions: require, assert, and revert. Require checks if a condition is true, and if not, it will revert the transaction and return an error message.

Using require allows you to prevent errors from happening in your contract. For example, you could use require to check that a user has enough balance to make a purchase, or that an address is valid before sending a transaction.

Upgradeable Smart Contracts

Upgradeable smart contracts are a type of contract that can be upgraded without the need to redeploy the contract. Upgradeable smart contracts allow you to make changes to a contract after it has been deployed, without effecting any of the data or code that is already on the blockchain.

Proxy Contracts

A proxy contract is a type of contract that allows another contract to execute its code. Solidity proxy contracts are useful for cases where you want to upgrade a contract but don't want to redeploy it.

Proxy contracts are also useful when developers want to execute a contract's code on a different blockchain. For example, you could use a proxy contract to execute a Solidity contract on an Ethereum testnet.

Multisig Contracts

A multisig contract is a type of contract that requires more than one signature to execute its code. Solidity multisig contracts are useful when developers want to require multiple people to approve a transaction before it is executed.

Multisig contracts are also useful for cases where developers want to limit the amount of money that can be spent in a certain period of time. For example, you could use a multisig contract to require two signatures for any transaction over $1,000.

Reentrancy Attacks

Reentrancy attacks are a type of attack that can occur in Solidity contracts when a contract calls another contract, and then the second contract calls back into the first contract or another untrusted contract, typically before the first contract has finished executing.

Reentrancy attacks can be used to exploit vulnerabilities in contracts. For example, an attacker could use a reentrancy attack to drain all the Ether from a contract.

The Best Way to Learn Solidity

No matter what your goals are, there is a way for you to learn Solidity that fits your needs. If you're looking for a quick and easy way to get started, tutorials are a great option. You can also check out our introduction to Solidity. If you want more structure and guidance, online courses might be a better fit. And if you're looking for an immersive, hands-on experience, a bootcamp could be the right choice.

Once you've chosen your learning method, there are a number of important concepts to ensure you get down, including smart contracts, functions, events, and more. By understanding these concepts, you'll be well on your way to becoming a proficient Solidity developer.

Build web3 with Alchemy

Alchemy combines the most powerful web3 developer products and tools with resources, community and legendary support.

Get started for free