#鐵人賽 #ethereum #solidity
今天來聊聊數值型態中的「bool」、「Integer」、「Address」、「Enum」
本日合約:
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;
contract Day4 {
// Boolean
bool public isMerge = true;
// Integer
int public I = -123;
uint public U = 999999;
int8 public I8 = -4;
uint256 public U256 = 3;
// Address
address public HydaiAddr = 0x9A76D78F203Ec6f7289bB0178cb6C25f18A9911E;
address payable public PayHydaiAddr = payable(HydaiAddr);
// Enum
enum Color { Blue, Green }
Color public C = Color.Blue;
}
影片連結: https://youtu.be/7tVu9_aF1v4
「Remix IDE」: https://remix.ethereum.org/
「本系列播放清單」: https://www.youtube.com/playlist?list=PLHmOMPRfmOxQYDnXAc1hKY6ra4WDU8ZlM