What is Smart Contract in Ethereum Blockchain?


Smart Contracts
Image Source: Coinfomania

Hi Guys, Welcome to The Proficiency Post. We have another great post for you today. We discuss Smart Contracts, how they work, why they’re necessary, and what the future holds. There are many examples of great companies that are using Smart Contracts in innovative ways. 

What is a Smart Contract

Simply said, a “Smart Contract” is a program that runs on the Ethereum blockchain. It’s a set of code and data stored on the Ethereum blockchain at a single address.

With Augur, you can have prediction markets, with NFTs by an artist like Beeple, you can own a unique piece of digital art, with Uniswap you can have decentralized exchanges, and finally, but most importantly, you can create innovative tokens of your own, if you want to. 

Thanks to blockchain technology, we now have two types of contracts, Paper contracts, and Smart Contracts. One is controlled by people, and the other is controlled by the blockchain. 

The term “Smart Contract” comes from computer scientist and cryptographer Nick Szabo. According to Szabo:

New institutions, and new ways to formalize the relationships that make up these institutions, are now made possible by the digital revolution. I call these new contracts “smart,” because they are far more functional than their inanimate paper-based ancestors. No use of artificial intelligence is implied. A Smart Contract is a set of promises, specified in digital form, including protocols within which the parties perform on these promises.

However, it was a 19-year-old Vitalik Buterin that brought Smart Contracts to life by creating Ethereum. He wanted people to have the ability to build and rapidly deploy efficient and secure decentralized applications. 

Here’s what he wrote in Ethereum’s white paper: 

Ethereum does this by building what is essentially the ultimate abstract foundational layer: a blockchain with a built-in Turing-complete programming language, allowing anyone to write Smart Contracts and decentralized applications where they can create their own arbitrary rules for ownership, transaction formats, and state transition functions. 

So you’ve just heard it from the venerable Vitalik, he wants you and everyone else to have god-like digital powers to create whatever you want on the blockchain using Smart Contracts. 

 How the heck do they work? 

A contract and Smart Contract are similar in that both have a list of rules they adhere to, and if certain conditions are met, certain events happen. 

If you try to cancel your subscription to Adobe too early, because you signed a contract, adobe will charge you a cancellation fee because you supposedly agreed to it. Damn you Adobe! A Smart Contract acts the same way that if certain conditions are met, the Smart Contract executes code automatically. 

The best way to think about Smart Contracts is like a vending machine or a microwave. With a vending machine, you insert a quarter, and outcomes your favorite Kombucha drink. With a Smart Contract, let’s say you’re trying to exchange one token for another, you just submit your order, and the decentralized exchanges swap tokens for you, no middleman required. 

Swap Token
Image Source: YouTube

With a microwave, you insert an amount of time, and 3 minutes later your delicious burrito is ready. 

With a Smart Contract, let’s say you’re going to Mars on an Elon Musk Space ship, you want to make sure your kids get your crypto money when they turn 20 years old in case you don’t return well, 20 years later, the Smart Contract will kick in and send that money to your loved ones so you don’t have to worry about it. 

What does a Smart Contract look like? 

Here’s an example code of a coin. It’s just a long list of codes. It’s no more complicated than your smart fridge or the printer that always runs out of expensive ink, damn you Epson!
Smart Contract Codes
Image Source: Google Pics

Here’s an example contract for voting, a contract for micropayments, and a contract for auctions. Once you’ve written your Smart Contract you have to deploy it to the blockchain using a service like Infura and Boom, your contract is public and people can interact with it directly.

Infura blockchain
Image Source: Infura.io

This is an example of a live contract on the Ethereum blockchain. 

So far we’ve learned Smart Contracts are a set of promises that will execute automatically no matter what. But how does a Smart Contract get information on how to make a decision? By using something called an Oracle

Imagine you’re in a room with no windows or doors. There are items for sale that you’re interested in buying, but none of the items have prices and they’re all hidden inboxes. The only way to find the prices and what item is in each box is if you use a radio to call your friend Kate that has a book of prices and a list of items. She tells you the item and prices for each box and you can now make a decision on what to buy. 

Item Prices

If a Smart Contract is a brain, then an Oracle acts like the eyes and ears for the brain. The Smart Contract can only interact with items on the blockchain, but if it needs information from the real world, then a Smart Contract needs an oracle, much like being in a closed room and having to radio Kate for information. 

Say a Smart Contract needed the price of gold to make a buy or selling decision, then the Smart Contract would connect to an oracle and the oracle would provide real-world gold prices, then the Smart Contract would act accordingly. Oracles are vitally important to a fully functioning Smart Contract. 

Because a Smart Contract delivers on promises automatically with the help of oracles, you have a mechanism that is faster and cheaper than the real-world counterpart, your paper contracts.


What are some of the real-world main use cases for Smart Contracts? 

  1. The banking industry will save time and costs in processing loans and other transactions. 
  2. The medical and healthcare industry will securely access patient and cross-institutional data. 
  3. Supply chains can utilize Smart Contracts to cut down on counterfeit products. 
  4. Real estate markets will reduce time and cost to property transactions. 
  5. The energy industry will cut down on waste.
  6.  The insurance industry will be able to increase public trust by keeping both companies and customers honest with their insurance claims since everything will be tracked on the blockchain. 

What are the Drawbacks?

There are three main flaws to a Smart Contract: they are:

  • Oracles
  •  Amendability
  • Legality


With Oracles, the problem comes with it being fed wrong information. If a bad actor purposely pumps and dumps the price of gold, the oracle may only remember the very high price, thus causing Smart Contracts to buy or sell gold at very high prices. 

However, there are oracles like the Uniswap oracle that are designed to be robust and smart enough to prevent manipulation. 


When it comes to Amendability, once a Smart Contract is uploaded to the blockchain it cannot be upgraded…per se. 

In 2016, a Smart Contract loophole allowed a hacker to steal $150 million worth of ether. That one hack forced a fork, or a split, creating two blockchains Ethereum and Ethereum classic. While Smart Contracts still can’t be edited several years later, there are workarounds, according to Parikshit Joshi, lead developer with Simform Solutions:

If you directly replace a Smart Contract with an upgraded one, you will lose all of your Smart Contract bound information from the blockchain…So whenever we write a Smart Contract – let’s take the case of Smart Contracts built on top of Ethereum – we have modular.sol files that can be easily upgraded without losing any information. This has helped us in making Smart Contracts a reality.


A Smart Contract is hard to legally enforce, mainly because everything is automated. The problems come with unforeseen circumstances. So you take real-world scenarios that can be messy, and a mechanism that can’t be upgraded, you may run into problems. 

Here’s an example: Let’s say a buyer purchases a First Edition “Lord of the Rings” signed by Tolkien himself through the blockchain. However, the signature turns out to be forged, and more than likely, there will be no “book is forged, please return my money” button on the Smart Contract. 

Basically, a Smart Contract can’t possibly think of every possible scenario, so the need for Smart Contract disputes will become a necessity. As you can see Smart Contracts are great, but they’re not perfect yet, they’re a work in progress, but in 5 to 10 years, I can’t see a world where you will not interact with a Smart Contract or blockchain mechanism at least once a day. 

To live in a better, more secure, and more efficient digital world, we need the help of technologies like Smart Contracts. I hope you enjoyed this article. 

Leave a Comment