Dwarves
Memo
Type ESC to close search bar

Smart Contract

Smart contracts

Smart contracts, also known as smart contracts, are computer programs that operate on the blockchain. Entities interacting with the contract do not need to know each other or trust each other.

How smart contract work:

Structure of a smart contract:

Declare variable

Function/Instruction

Event/Log

Invoke another smart contract:

Currently, Ethereum there are many contracts such as tokens, NFT-ERC721, games, swaps, lending… To work directly with these contracts you can make calls directly from your application from javascript or go lang via ABI, ABI is an interface type similar to API specification file or description file. describe swagger. It defines data objects and callable functions. Or you can also call the interface of another contract in your contract for example:

The advance of smart contracts:

The limitation of smart contracts:

Take for example a smart contract when deployed When a Decentralized Autonomous Organization (DAO) named “The DAO” was hacked in 2016, millions of ETH were stolen due to a mistake in their smart contract code. Since their Smart Contract is immutable, developers cannot edit the code. This eventually led to a hard fork, creating Ethereum Classic and Ethereum.

Reference

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