// SPDX-License-Identifier: MIT
代表軟體授權協議
pragma solidity ^0.8.21;
代表版本需 >= 0.8.21 且 < 0.9.0
- Value type: Boolean, Integer
- Reference type: Array, Struct
- Mappping type: Key-value pair
- ! => not
- && => and
- || => or
- == => equal
- != => not equal
- int (Including negative number)
- uint (Only positive number)
- uint256 (256 bytes positive number) => 0~2^256-1
Note: uint = uint256
- payable address: 相比address, 多了transfer與send
- Fixed length string(Value type) 最多32bytes
bytes32 public _byte32 = "MiniSolidity";
若轉成16進制 => 0x4d696e69536f6c69646974790000000000000000000000000000000000000000
bytes1 public _byte = _byte32[0];
_byte為_byte32的第一個字節: 0x4d
- Non Fixed length string(Reference type)