목록분류 전체보기 (171)
2020.코딩일지
Samsung SL-J1560W Series 삼성전자서비스 홈페이지 (/index.do)에서 드라이버를 다운로드
https://dbdiagram.io/ dbdiagram.io - Database Relationship Diagrams Design Tool dbdiagram.io Table users { id int user_id varchar20 user_pwd varchar20 user_nick varchar20 user_pfp text address varchar100 private_key varchar100 haes_sal_amount int ip_amount int crop_count int crop_per int created_at timestamp } Table rand { id int address varchar100 tile json } Table bag { id int address varchar1..
오버플로우 0.8버전 기준으로 이전과 이후를 비교 // SPDX-License-Identifier: GPL-3.0 pragma solidity >=0.7.0 overflow revert // overflow: 0~255 -> 257 -> 1 library SafeMath { //0~255; 0.8이전버전에서는 합이 255가 넘으면 오버플로우가 발생. // 0.8이후버전에서는 255가 넘으면 에러발생 // a:1 b:255 -> a+b= 256 -> (오버플로우로 0이됨)0 >= 1 -> false // a:0 b:256 -> b에서 uint8이라 에러발생 function add(uint8 a, uint8 b) internal pure returns (uint8) { require(a+b >= a, "Sa..
enum // SPDX-License-Identifier: GPL-3.0 pragma solidity >=0.7.0 =0.7.0
// SPDX-License-Identifier: GPL-3.0 pragma solidity >=0.7.0
payable // SPDX-License-Identifier: GPL-3.0 pragma solidity >=0.7.0 =0.7.0 = msg.value, "Your balance is not enough"); _to.transfer(msg.value); emit SendInfo(msg.sender, (msg.sender).balance); //event로 전송하고 남은 잔액이 나옴 } function checkValueNow() public { emit MyCurrentValue(msg.sender, msg.sender.balance); } function checkUserMoney(address _to) public{ emit CurrentValueOfSomeone(msg.sender, _to, _..
// SPDX-License-Identifier: GPL-3.0 pragma solidity >=0.7.0 25, "You are not allowed to pay for the cigarette"); return "You payment is succeeded"; } function onlyAdults32(uint256 _age) public pure returns(string memory) { require(_age>25, "You are not allowed to pay for the cigarette"); return "Your payment is succeeded"; } //위의상황을 아래와같이 modifier로 개선------------------------------------------- m..
return // SPDX-License-Identifier: GPL-3.0 pragma solidity >=0.7.0 =0.7.0
error // SPDX-License-Identifier: GPL-3.0 pragma solidity >=0.7.0 19,"You are not allowed to pay for the cigarette" ); return "Tour payment is acceeded"; } } try-catch문 // SPDX-License-Identifier: GPL-3.0 pragma solidity >=0.7.0