Onyinyechi Uzoma
3 min readSep 10, 2022

--

SMART CONTRACTS FOR DUMMIES

Smart contracts are basically programs that run on the Ethereum blockchain.

They are fundamental building blocks of Ethereum applications.

Before we dive deeper let’s go over some terms:

Program: These are coded software instructions that tell the computer what to do.

Blockchain: A blockchain is a digitally distributed and decentralized database that stores the records of one’s digital assets. It is secure and promotes transparency.

A simple analogy for how blockchain technology operates can be compared to how a Google Docs document works. When you create a Google Doc and share it with a group of people, the document is simply distributed instead of copied or transferred. This creates a decentralized distribution chain that gives everyone access to the base document at the same time.

The two most popular examples of blockchain are Bitcoin and Ethereum.

What is a contract?

A contract is an agreement between two of more people which is mostly written but can also be verbal.

The term “smart contract” was coined by Nick Szabo In 1994, he wrote an introduction to the concept and, in 1996, an exploration of what smart contracts could do.

Why replace Traditional Contracts with Smart Contracts?

One of the problems of conventional contracts is breach of trust.

There’s need for trusted individuals who would carry through with their agreement when the agreed condition is met.

For instance Ezinne and I made a bet that if my football club wins she has to give me fifty thousand naira but if hers wins, I will have to give her the same amount.

I had to trust that Ezinne would carry out her own part of the agreement.

The match ends, my team wins but Ezinne claims that she never made that bet and storms out.

Smart contracts aim at solving the problem(breach of trust) by digitizing agreements into computer codes which is automatically executed when the contract terms are met.

A good example is a vending machine, it will only give the required product once you have fulfilled the requirement. of inserting the exact amount of money. If there is a deficit, the vending machine would not dispense the product.

FEATURES/ADVANTAGES OF SMART CONTRACTS

-Automatic execution: It doesn’t rely on humans to execute. It is programmed, signed by both parties and deploy on the blockchain, once the conditions are met it automatically executes.

-Predicted Outcomes: Two people may interpret a traditional contract in different ways. Smart contracts eliminates the probability of different interpretations because it precisely executes what has been written in the code.

-Immutability: Once deployed the code on a smart contract cannot be changed, this is to promote customer protection. The only way to modify a smart contract is to deploy a new instance.

-Public Record: Smart contracts are also useful for audits and tracking. Since they are on a public blockchain, anyone can track asset transfers and other related information.

-Permission-less: Anyone can write and deploy a smart contract, no permission or legal personnel involved.All that is needed is the knowledge of a smart contract language Eg Solidity, Vyper and enough ETH to deploy the contract.

SMART CONTRACT USE CASES

Smart Contracts are autonomous,secured, trustless, accurate and performs really fast.They can do anything normal computer programs can do. Here are some examples:

•Stable coins

•Decentralized gaming

•Insurance policy that pays automatically

•An automatic, open currency exchange

•Creating and distributing unique digital assets like nfts.

LIMITATIONS:

-Smart contracts alone cannot get information about “real-world” events because they can’t send HTTP requests. Relying on external information could jeopardize consensus, which is important for security and decentralization.

-Another limitation of smart contracts is that maximum contract size must not exceed 24KB or it will run out of gas. This can be circumnavigated by using The Diamond Pattern.

References:

https://builtin.com/blockchain

https://ethereum.org/en/developers/docs/smart-contracts/

https://101blockchains.com/smart-contract-use-cases/?gclid=Cj0KCQjw6_CYBhDjARIsABnuSzrzi2qBe0PtuQmoQmhRT_pw5OyxVtsTLvDAF6rJn1wGo1p3LgSOjPIaAszXEALw_wcB

--

--