preface

A smart contract is a compiled piece of code that runs on Ethereum’s EVM. In this article, I’ll go into more detail about what smart contracts mean, how to change your mindset when developing them, and how to avoid pitfalls.

Intelligent contract

Smart contracts are no different from regular code, running on a distributed platform like Ethereum. This platform gives the code immutable, deterministic, distributed, and self-validating states. The storage of state during code execution is immutable. Everyone can open their own node, replay the entire blockchain, and get the same result.

In Ethereum, each contract has a unique address to identify itself. The client can interact with this address, send and receive ether, call functions, query the current state, etc.

Smart contracts are essentially code and the state of the code stored on the blockchain after it runs. The wallet you use to send and receive ETH, for example, is essentially a smart contract with an interface wrapped around it.

What is the GAS

Now that smart contracts are mentioned, GAS limits come with them. Smart contracts, which are pieces of code, run across a distributed network. Because every node in the network is a full node. The advantage of such a fault tolerance is strong, the disadvantage is low efficiency, consumption of resources and time. Because performing calculations costs money, the amount of computation to perform is directly related to the code. Therefore, each underlying operation running on the network requires a certain amount of gas. Gas is just a name, it stands for the cost of implementation. For more information, please refer to:

What does it mean to develop smart contracts

Developing intelligent contract means what, or why do we need to develop intelligent contract, this is a question need to think about, usually the sample is usually vote, bidding, tokens, and so on, these but these examples always lets a person very confused, why use smart contracts to implement these things, can achieve some real value, more commonly, Something that relates to a real contract. I’ve introduced you to what a contract is, but it’s probably not clear to you whether a contract can be equal to a contract, whether a contract is binding, provides constraints between two parties (contracts are usually two or more parties), and whether smart contracts are legally binding today.

Do we need smart contracts

Although blockchain is very popular now, we must admit that its application is not very wide, and only a few specific industries are suitable for use.

Contract development

The current common language is the Solidity class JS language, which uses Remix as a tool for editing, compiling and debugging. Or write the code locally using a text editor, save it as an.sol file, and compile the source code as an.abi.bin file using the Solcjs tool.

How contracts are deployed

  1. Terminal Deployment
  2. Deploy via Web3JS
  3. Deploy through the JsonApi

reference

Ethereum 4- Write a simple smart contract understanding of GAS in Ethereum

My website source: www.gethgeek.com/archives/sm…