1. What is a Smart Contract?
According to an opinion smart contract is a special protocol intended to contribute, verify or implement the negotiation or performance of the contract. The key element of smart contracts as well as one of most attractive things is opportunity to perform reliable transactions without intermediaries or any third parties. These transactions are trackable, transparent and irreversible. Smart contracts contain all the information about the contract terms and execute all envisaged actions automatically.
According to another opinion smart contracts are self-executing electronic instructions drafted in computer code. Smart contracts self-execute the stipulations of an agreement when predetermined conditions are triggered. The parties “sign” the smart contract using cryptographic security and deploy it to a distributed ledger, or blockchain.
Considering both information technology and legal aspects of the smart contracts’ nature, the smart contract application issue frequently rises many complex questions currently being unregulated in most of jurisdictions.
2. Legal issues related to Smart Contracts
Previous post mirrored certain of major legal issues related to smart contracts. Nevertheless, it is not possible to cover absolutely all aspects of pros and cons or drawbacks of new technology in general and smart contracts particularly. In this regard it is important to notice that legislative bodies of the countries willing to legally regulate of smart contracts will have to pay attention also to following questions:
Smart contract equality to traditional contract.  Legislators will have to identify smart contracts as an act equal to a traditional contract or it will be identified as the tool for enforcement of obligations;
Certifying Authority. States most likely will need to create a regulator dealing with certification keys and monitoring of involved parties into transaction in order to create a reliable mechanism and avoid any fraudulent actions or misconduct of the contracting parties.
Understanding of coded terms. If a contract is partly expressed in code, then the understanding of that code by the parties is relevant.  This relevance can be a matter of regulation, such as whether particular parties (such as consumers) can be bound by terms which they do not understand, or it can be a matter of fundamental contract law, such as whether there was sufficient mutual understanding of the terms to form the contract at all;
Evidence of coded terms. Even though the parties can agree to express specific terms of their relationship in computer code, it is important that that expression is admissible in any judicial and arbitral proceedings which arise out of that relationship.  An inability to admit this record of the parties’ agreement would impair its legal effectiveness.
3. Smart Contract’s Structure
Each smart contract has a small database and provides methods for changing its data. Since contracts are replicated across all nodes, their databases also are. Data changes occur via transactions.
A smart contract usually has at least the following structure:
- Transaction sender
- Transaction recipient
- The amount of sending currency
- Gas limit per transaction (it’s the maximum amount of units of gas you are willing to spend on a transaction)
- Price per gas unit (the payment received by the network participant for calling a smart contract code)
- Arbitrary data (optional) – If you’re told that you can sendarbitrary data yourself, it means you can send anything you want. 
ERC stands for “Ethereum Request for Comments”, while ERCXX are technical standards used for smart contracts on the Ethereum blockchain. Most of the major tokens on the Ethereum blockchain are ERC20-compliant. ERC20 tokens must use ‘gas’ to process transactions. Gas represents the work needed to perform a computation, for example a smart contract. Gas is not a token or a cryptocurrency. Gas is paid out in Ethereum. Transactions with more gas will be prioritized by the blockchain network, and processed more quickly.
4. Gas & Price
Every transaction in Ethereum requires Gas to be mined, and the Gas costs Ethers. So, each Smart contract transaction requires Ethers (which is paid not by the Smart Contract itself but rather by the users). Gas is an abstract number that represents the relative complexity of operations. While gas is fixed per operation, the amount a user pays per gas — gas price — is dynamic and dictated by market conditions. Gas price is a value representing how much Ether the user is willing to pay per gas. When a user sends a transaction, they specify the gas price, and the total fee that they pay is equal to formula: gas_price multiply to gas_used. Miners are paid out this fee and so they prioritize transactions with a higher gas price. The higher gas price you are willing to pay, the faster your transaction will be processed.
5. Stages of Smart Contracts creation
To create a Smart contract, you need to go through several stages as follows:
Compiling – After writing a contract in Solidity, use Solc to compile it. It’s from the C++ libraries (different implementations complementing each other again) which can be installed here.
Testing – The tests needs to cover the features of your code and assert that everything is working as predicted. As we are writing smart contracts that can deal with money, writing tests is a really important task for us. This includes: a) code review; b) testing audits; c) correctness proofs.
6. Language for writing Ethereum Smart-Contract: Solidity
A contract in the sense of Solidity is a collection of code (its functions) and data (its state) that resides at a specific address on the Ethereum blockchain. Solidity is a contract-oriented, high-level language that is designed to target the Ethereum Virtual Machine (EVM – The Ethereum Virtual Machine or EVM is the runtime environment for smart contracts in Ethereum). The code is statically typed, supports inheritance, libraries and complex user-defined types among other features.
7. Deploying smart contract in Ethereum blockchain
Once you have written a contract, you need to test it by actually deploying it and testing if they are functioning as expected. This is where testnets come to the rescue. Testnets simulate the Ethereum network and EVM. They enable developers to upload and interact with smart contracts without paying the cost of gas.
 SAMUEL BOURQUE & SARA FUNG LING TSUI, A LAWYER’S INTRODUCTION TO SMART CONTRACTS 4 (2014).
 INST. OF INT’L FIN., GETTING SMART: CONTRACTS ON THE BLOCKCHAIN 2 (2016).