address
:0x0000000000000000000000000000000000000000
bool
:False
bytes32
:0x0000000000000000000000000000000000000000000000000000000000000000
Bytes[N]
:0x
String[N]
:""
decimal
:0.0
uint8
:0
int128
:0
int256
:0
uint256
:0
example_address: public(address)
example_bool: public(bool)
example_bytes32: public(bytes32)
example_bytes: public(Bytes[255])
example_string: public(String[255])
example_uint256: public(uint256)
example_decimal: public(decimal)
映射
:所有元素为其类型的默认值结构
: 所有元素为其类型的默认值数组
:- 固定长度数组:所有元素为其类型的默认值
- 动态数组:空数组
[]
example_mapping: public(HashMap[uint256, uint256])
struct ExampleStruct:
id: uint256
name: address
example_struct: public(ExampleStruct)
example_array: public(uint256[3])
example_dynarray: public(DynArray[uint256, 3])