data type

kim·2021년 12월 5일

solidity

목록 보기
1/5

#### 이 내용은 D_One님의 솔리디티 깨부수기 강좌를 보고 공부한 내용입니다.

data type 에는 boolean, bytes, address, uint 4가지가 있다.

boolean : true / false

bool public b = false;

// ! || == &&
bool public b1 = !false;  //true
bool public b2 = false || true; // true
bool public b3 = false == true; // false
bool public b4 = false && true; // false

bytes4 public bt = 0x12345678;
byte public bt2 ="STRING";

address는 스마트컨트랙트를 배포할 때 생기는 주소 20바이트(이더리움 address의 크기)를 담을수 있음

int와 uint는 -가 있느냐 없느냐의 차이
ex) int8 : -2^7 ~ 2^7 -1
uint8 : 0 ~ 2^8-1

0개의 댓글