Solidity的完整语法:
Solidity源文件结构:
- 语法版本
- 引入外部源文件
- 注释
- 状态变量
- 函数
- 函数修饰器
- 事件Events
- 结构体类型Struct
- 枚举类型Enum
值类型:
- 类型
- 布尔(Booleans)
- 整型(Integer)
- 地址(Address)
- 字节数组(byte arrays)
- 小数
- 字符串(String literal)
- 十六进制字面量
- 枚举
- 函数(Function Types)
引用类型:
其他类型:
- 映射/字典(mappings)
- 左值运算符(Operators Involving LValues)
- 类型间的转换(Conversions between Elementary Types)
- 类型推断(Type Deduction)
单位和全局变量:
语言内置特性:
- 特殊变量及函数(Special Variables and Functions)
- 数学和加密函数(Mathematical and Cryptographic Functions)
- 地址相关(Address Related)
进阶:
- 入参和出参(Input Parameters and Output Parameters)
- 控制结构
- 函数调用(Function Calls)
- 创建合约实例(Creating Contracts via
new
) - 表达式的执行顺序(Order of Evaluation of Expressions)
- 赋值(Assignment)
- 作用范围和声明(Scoping And Decarations)
- 异常(Excepions)
- 内联汇编(Inline Assembly)
合约详解:
- 合约
- 可见性或权限控制(Visibility And Accessors)
- 访问函数(Accessor Functions)
- 函数修改器(Function Modifiers)
- 常状态变量(constant state variables)
- 回退函数(fallback function)
- 事件(Events)
- 继承(Inheritance)
- 接口(Abstract Contracts)
其它:
- 库(Libraries)
- 状态变量的存储模型(Layout of State Variables in Storage)
- 内存变量的存局(Layout in Memory)
- 调用数据的布局(Layout of CallData)
参考:https://solidity.readthedocs.io/en/develop/solidity-in-depth.html
https://solidity.readthedocs.io/en/develop/solidity-in-depth.html