Writing First Smart Contract

Learn the basics of the Solidity programming language and how to define a simple smart contract in Solidity.

In this lesson, we'll implement our first smart contract and go through every line to understand how it works. This will allow us to cover basic Solidity features and see how it differs from other programming languages.

Defining a smart contract

Let’s start by writing one of the simplest possible smart contracts. Our first smart contract will only be able to store a single integer variable in an Ethereum network and allow us to change it and read its current value.

Here's a complete definition that takes just a few lines of Solidity code.

Get hands-on with 1200+ tech skills courses.