송금 외부 컨트랙트의 함수 호출 가변 gas(send, transfer는 2300 gas로 고정(가스비 상승으로 트랜잭션 성공 보장 못함)) re-entrancy(재진입) 공격의 위험 있음, 따라서 Checks Effects Interactions Pattern 사용 // SPDX-License-Identifier: GPL-3.0 pragma solidity 0.8.11; contract Adder { function add(uint _num1, uint _num2) public pure returns (uint) { return _num1 + _num2; } event received(string _str); event fallbacked(string _str); receive() external pa..
send: 2300 gas 소모, 성공 시 true, 실패 시 false 리턴 transfer: 2300 gas 소모, 실패 시 에러 리턴 call: gas양 지정 가능, 지정하지 않으면 자동으로 들어감. 성공 시 true, 실패 시 false 리턴. 재진입 공격에 취약. 하지만 가스비가 상승한 이후로 gas가 동적을 설정되는 call 함수 사용을 권장 event spendLog(uint256 _value); function sendNow(address payable _to) public payable { bool sent = _to.send(msg.value); require(sent, 'Failed'); emit spendLog(msg.value); } function transfetN..
- Total
- Today
- Yesterday
- Hardhat
- Truffle
- erc20
- 스마트 컨트랙트
- avalanchego
- 블록체인
- Call
- swr
- interface
- ethers.js
- caver-js
- ERC721
- nft
- Android
- typescript
- Upgradeable Contracts
- Flutter
- Proxy Pattern
- web3.js
- web3
- metamask-extension
- 앱 아이콘
- ganache
- JWT
- eslint
- web3-token
- 이더리움
- class
- 블록 탐색기
- caver.js
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 1 | 2 | 3 | 4 | 5 | 6 | |
| 7 | 8 | 9 | 10 | 11 | 12 | 13 |
| 14 | 15 | 16 | 17 | 18 | 19 | 20 |
| 21 | 22 | 23 | 24 | 25 | 26 | 27 |
| 28 | 29 | 30 | 31 |