Solidity 是一门面向合约的、为实现智能合约而创建的高级编程语言。这门语言受到了 C++,Python 和 Javascript 语言的影响,设计的目的是能在以太坊虚拟机(EVM)上运行。

在线编辑网站:

Remix - Ethereum IDE

For Example:

pragma solidity >=0.4.0 <0.6.0;

contract SimpleStorage {
   uint storedData;

   function set(uint x) public {
      storedData = x;
   }

   function get() public view returns (uint) {
      return storedData;
   }
}

关键字列表:

abstract after alias apply auto case
catch copyof default define final immutable
implements in inline let macro match
mutable null of override partial promise
reference relocatable sealed sizeof static supports
switch try typedef typeof unchecked

具体使用:

基本语法

函数操作

Solidity常用的两种模式

智能合约