Smart contracts and their issues.

Introduction

In a world with no governments and no legal practitioners to enforce laws for you to abide by and all there is to keep sanity is code. More or less code dictates what we can and cannot do. With the current developments of smart contracts, this idealistic scenario is not far-fetched.

Smart contracts work as digital agreements that are enforced by a specific set of rules and these contracts are stored and executed by all network nodes on the blockchain to make it trustless and secure. smart contracts are capable of receiving storing and sending funds and its also capable of calling other smart contracts. A smart contract system often follows "if… then…" semantics and it is aimed at removing the human factor from decision-making. But despite being a popular industry jargon, smart contracts are not legal contracts nor is it smart. They are just a piece of code after all.

Analogy of how smart contracts work

Using a very popular analogy of how a vending machine works we can better understand how smart contracts work. Vending machines are programmed in a way that allows certain actions to happen based on the input given to them.

For example: if you want to buy a can of coke that cost $2 and you only have $1 no matter how much you try you won't be getting that can of coke. Alternatively, if you insert $3 the machine will give you a can of coke and the appropriate change. This is the same for smart contracts, they work in a deterministic way and rely solely on the information available on the blockchain. Ethereum is a good example of a blockchain that supports smart contracts and makes it possible for programmers to implement their smart contracts. solidity is a programming language that allows programmers to write smart contracts.

Some key features

since Ethereum is the most popular we are going to look into its characteristics

Decentralized. There's no single entity controlling the contract, infact all the nodes in the Ethereum network start the same contract in exactly the same state

Deterministic. Smart contracts are programmed to execute actions, given the requirements are met. Also, the outcome will always be the same, no matter who executes them.

Immutable. Smart contracts cannot be modified after deployment. They can only be "deleted" if a particular function was previously implemented. Thus, we may say that smart contracts can provide secure code.

Autonomous. Smart contracts can automate all sorts of tasks, like receiving, storing and sending funds. In most cases, though, if a smart contract isn't triggered, it will stay "dormant" and won't perform any action.

Transparent. Since smart contracts are based on a public blockchain, their source code is not only immutable but also visible to anyone.

ERC-20

ERC-20 guides the creation of new tokens on the Ethereum blockchain so that they are interchangeable with other tokens used within smart contracts. Tokens issued on the Ethereum blockchain follow the ERC-20 token standard. Most of the tokens being deployed on the cryptocurrency exchanges are making use of this ERC-20 standard.

Ways smart contracts today fall short

The ability to securely manage financial assets of real value on a decentralized network has turned out to be the most important use of blockchain technology, the mere potential it has to remake global finance in a democratized model at the scale of hundreds of trillions of dollars and billions of users is revolutionary. But today, smart contracts have failed to meet standards that make them ready for mass adoption.

The problem is not that smart contracts are not effective in today's use case, but the problem stems from the fact that the way smart contracts are developed makes them unready to scale up in the first place. For smart contracts to be ready for mass adoption, four requirement needs to be met and these requirements are, the way developers build smart contracts must be easy, safe, reusable, and composable.

Easy. If the development paradigm is easy enough, it opens up a world of developers who can seek the opportunity of building better financial products and services.

Safe. Not only must building smart contracts and dApps be easy, but the result must be confidently trusted to correctly manage many millions of dollars.

Reusable. Developers need to be able to leverage the work of others to build better solutions.

Composable. Smart contracts need to have the ability to connect with one another.

Conclusion

In essence development of these smart contracts and dApps need to be on a platform that makes the work easier for developers to build better products and in turn makes these smart contracts safer for transaction considering the fact that these contracts will be used by millions of users to transact billions of dollars.

if you have any questions you can hit me up on:

Twitter twitter.com/DevOzi7?t=Z3DPygetZOcsC_3qYGYeP..