2022년 2월 24일 https://www.youtube.com/watch?v=QYeBPgqKgIc&list=PLJQKWHLhBrxI43w0DU4uQrhWv4Pm1OFlx

remix

// SPDX-License-Identifier : GPL-30
pragma solidity >= 0.7.0 < 0.9.0;

contract lec {
}

Solidity 솔리디티 강좌 1강 - Hello Solidity

smart contract

deploy

// SPDX-License-Identifier : GPL-30
// 이거 안써주면면 에러남 👀

pragma solidity >= 0.7.0 < 0.9.0;
// 사용할 버전 명시

contract Hello {
  string public hi = "Hello solidity";
}

Solidity 솔리디티 강좌 2 강 - data type

// SPDX-License-Identifier : GPL-30
// 이거 안써주면면 에러남 👀

pragma solidity >= 0.7.0 < 0.9.0;
// 사용할 버전 명시

contract Hello {
    bool public b = false;

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

    //bytes 1 ~ 32 
    bytes4 public bt = 0x12345678; // (2개 1byte)
    bytes public bt2 = "STRING"; // 

    //address : 은행계좌처럼 주소라고 생각하면됨, 스마트컨트랙 마다 배포되면 address가 생김
    // 보통 20bytes => 40자리
    address public addr = 0x29df177BC70966849B2633afc9F12f0C443AEC1A;

    // int vs uint (+, -, *, /)

    // int8 (-2^7 ~ 2^7 - 1)
    int8 public it = 4;

    // uint (0 ~ 2^8 - 1)
    uint256 public uit = 132213;

    uint8 public uit2 = 255; //255까지만만 가능
}