Solidity_study
2024-03-12 18:09:33 0 举报
AI智能生成
登录查看完整内容
随着学习深入将不定期持续更新 在完善所有知识点将允许克隆
作者其他创作
大纲/内容
The possible values are constants true and false.
! (logical negation)
== (equality)
!= (inequality)
Operators
Booleans
int / uint: Signed and unsigned integers of various sizes.
Keywords uint8 to uint256 in steps of 8 (unsigned of 8 up to 256 bits) and int8 to int256.
The value of a comparison is the one obtained by comparing the integer value.
x << y is equivalent to the mathematical expression x * 2**y.
Division
Modulo
Exponentiation
Integers
Fixed Point Numbers
Rational and Integer Literals
Holds a 20 byte value (size of an Ethereum address).
address
address payable
The two flavous
Type conversions
Members of Addresses
Address
Address Literals
Every contract defines its own type. You can implicitly convert contracts to contracts they inherit from. Contracts can be explicitly converted to and from the address type.
Contract Types
Enums
string memory a = unicode"Hello 😃";
Unicode Literals
Hexadecimal Literals
\\<newline> (escapes an actual newline)
\\\\ (backslash)
\\' (single quote)
\\" (double quote)
\ (newline)
\ (carriage return)
\\t (tab)
the following escape characters:
String Literals and Types
.length yields the fixed length of the byte array (read-only).
Members
Fixed-size byte arrays
bytes
string
Dynamical-sized byte array
Definition: type C is V
User Defined Value Types
Internal functions(By default)
External functions
two flavours
function (<parameter types>) {internal|external} [pure|view|payable] [returns (<return types>)]
Function types are notated as follows
pure functions can be converted to view and non-payable functions
view functions can be converted to non-payable functions
payable functions can be converted to non-payable functions
Conversions
No other conversions between function types are possible.
.address returns the address of the contract of the function.
.selector returns the ABI function selector
External (or public) functions have the following members
Function Types
Value Types
memory
storage
calldata
three data locations
Data location
T[k]
fixed sized arrays
dynamic size arrays
Definition
Arrays
Structs
Reference Types
Iterable Mappings
Mapping Types
Data Types
Order of Precedence of Operators
Operator
Variable
Control Structures
Function Calls
Creating contracts via new
Order of Evaluation of Expressions
Assignment
Scoping and Declarations
Expressions and Control Structures
分支主题
Ether Units
Time Units
Units
Units and Globally Available Variables
Contracts
Solidity.0.8.0
收藏
收藏
0 条评论
回复 删除
下一页