Create and Test a Solidity Smart Contract with a Public Variable

Share this video with your friends

Send Tweet

The first step in this journey will be get your hands into a new language to harness the power of the blockchain. I'm talking about Solidity

**This isn't a Solidity focused course but we will review some concepts to get you up to speed with it.

The first thing to notice is that Solidity is an statically-typed language created specifically to create smart contracts for the Ethereum network.

An smart contract is like "real life" contract. Is a way to establish terms for an agreement. But the "smart" part it's because this type of contract is declared as machine code that is executed in a blockchain. This expand the idea of the original blockchain, Bitcon, aout sending and receiveing money without a centralized intermiediary to create trust and make possible to automate and dcentralize virtually any kinf of deal or transaction.

Since the contracts run in the blockchain (like Ethereum network) they offer high security, trust, inmmutability and reliability.

Since the blockchain is immutable you have to be care on what are you deploying. After deployed it cannot be change and you'll need to deploy a new contract.

For Solidity, a contract is a collection of code (a program) and data (the state) that lives inside the blockchain, it can be identify by its Ethereum address. You can leverage your previous knowledge and use some analogies to understand the smart contract.

You can think on the contract as your "backend" or "server side" program. This server expose an API and store some data (the state) into the a databse (the blockchain), but the database is not written nor query with a different language like SQL, you can imagine that Solidity is automatically connected to the database and everything you deeclare (like a variable) is stored in the database.