【試讀版】All In One Solidity
KrypltoCampChiHaoLu
  • Welcome!
  • | Chapter 0 | Intro
    • 【推薦序】
    • 【前言】
  • Part I Basic
    • | Chapter 1 | 基本介紹 Introduction
      • 【環境建置 Remix IDE】
      • 【版本控制】
      • 【Hello World & First Contract】
      • 【Practice】
      • 【Answer】
    • | Chapter 2 | 型別 Types & 變數 Variables
      • 【Integer】
      • 【Bool】
      • 【Address】
      • 【Contract & This】
      • 【String】
      • 【Scope】
      • 【Practice】
      • 【Answer】
    • | Chapter 3 | 單位 Unit & 運算子 Operators
      • 【單位】
      • 【Time】
      • 【運算子】
      • 【Practice】
      • 【Answer】
    • | Chapter 4 | 流程控制 Selection and Repetition
      • 【If-Else】
      • 【For】
      • 【While】
      • 【Practice】
      • 【Answer】
    • | Chapter 5 | 函式 Function
      • 【Returns】
      • 【Visibility】
      • 【stateMutability】
      • 【Constructor】
      • 【Function Overloading】
      • 【Fallback】
      • 【Useful Function】
      • 【Practice】
      • 【Answer】
    • | Chapter 6 | 資料結構 Data Structures
      • 【Array】
      • 【Mapping】
      • 【Structs】
      • 【Enum】
      • 【Practice】
      • 【Answer】
    • | Chapter 7 | 角色和全局訊息 Global Variables
      • 【Msg】
      • 【Block】
      • 【ABI】
      • 【TX】
      • 【Practice】
      • 【Answer】
  • Part II Medium
    • | Chapter 8 | 記憶體配置 Memory Allocation
    • | Chapter 9 | 異常處理 Handling Exception
      • 【Require】
      • 【Assert】
      • 【Revert】
      • 【Try/Catch】
      • 【Practice】
      • 【Answer】
    • | Chapter 10 | 事件 Event
      • 【emit】
      • 【Indexed】
      • 【web3.eth.subscribe()】
      • 【Logs with Data & Topics】
      • 【anonymous】
      • 【Practice】
      • 【Answer】
    • | Chapter 11 | 繼承 Inheritance
      • 【Inheritance】
      • 【Modifier】
      • 【合約互動】
      • 【Function Overriding】
      • 【Polymorphism】
      • 【多重繼承與 super】
      • 【Practice】
      • 【Answer】
    • | Chapter 12 | 介面 Interface
    • | Chapter 13 | 引用 Imports & 函式庫 Libraries
      • 【Library】
      • 【Import】
      • 【OpenZeppelin】
      • 【Practice】
      • 【Answer】
    • | Chapter 14 | ERC & Token
  • PART III Advanced
    • | Chapter 15 | 佈署 Deploy & 編譯 Compiler
    • | Chapter 16 | 開發工具 Dev. Tools
    • | Chapter 17 | 最佳化合約 Contract Optimization
  • | OTHERS | Information & Reference
    • 【結語】
    • 【參考資料】
Powered by GitBook
On this page

Was this helpful?

  1. Part I Basic

| Chapter 1 | 基本介紹 Introduction

最好學習 Solidity 的方法其實就是直接寫一次!

智能合約

智能合約的概念最早由 Nick Szabo 於 1994 年提出,作為區塊鏈的一部分,他是一個狀態機(state machine)的存在,需要「交易(transactions)」來更改狀態(state),同時也可以做任何的邏輯運算(logic operation)。

透過智能合約修改區塊鏈上的各種「狀態」都需要透過交易和挖礦打包這兩個動作。同時其是圖靈完備的,所以可以解決任何的電腦問題。

智能合約的運作過程為:Smart Contract code(programming language) -> compiler -> EVM bytecode,這個部分在未來章節會做解釋!

Solidity

Solidity是目前針對以太坊虛擬機設計中,最知名的智能合約編輯語言。屬於編譯型語言,而非直譯型語言。最早在2014年由撰寫以太坊黃皮書的 Gavin James Wood 提出,設計參考了 ECMAScript ,所以也會有人認為寫過 JavaScript 的工程師對 Solidity 較為上手。

撰寫智能合約並不單只有 Solidity,還有其他的智能合約語言像是:

  • Serpent: 基於 python的智能合約語言

  • LLL: 類似 Low-Level 的組合語言

  • Mutan: 已經被棄用的類似 Go 的語言

  • Viper: 類似 python的實驗型語言

Previous【前言】Next【環境建置 Remix IDE】

Last updated 3 years ago

Was this helpful?