일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- tcp
- ERC165
- ERC20
- web3
- Docker
- server
- truffle
- github
- web3.js
- MySQL
- solidity
- blockchain
- Ethereum
- Python
- 제어의역전
- NFT
- git
- JavaScript
- 네트워크
- 블록체인
- 이더리움
- 스마트 컨트랙트
- 솔리디티
- 트랜잭션
- web
- erc
- ethers
- erc721
- Programming
- geth
- Today
- Total
목록솔리디티 (7)
멍개의 연구소

안녕하세요. 멍개입니다. abi-decoder 라이브러리를 이용하여 transaction에 포함된 inputData를 해석하는 방법을 다뤄보도록 하겠습니다. · abi-decoder 모듈설치 $ npm install --save abi-decoder npm을 이용하면 간단하게 설치할 수 있습니다. · abi 추출하기 transaction의 inputData를 디코딩하기 위해서는 해당 컨트랙트의 ABI가 필요합니다. pragma solidity 0.5; contract test { uint var1 = 10; string var2 = "hello world"; function setData(uint a, uint b, string memory c) public { var1 = a + b; var2 = c;..

solidity에서 call과 delegatecall에 대해서 다뤄보겠습니다. 우선 이번글은 solidity 0.5 버전 기준으로 합니다. call과 delegatecall은 0.5 버전 전, 후로 사용법이 바뀌었습니다. ● 샘플코드 먼저, call과 delegatecall을 사용한 sample 코드부터 확인하겠습니다. pragma solidity ^0.5; contract Sample1 { uint public t ; constructor() public { } event L(uint a, uint b, address c); function test(uint a, uint b) public returns(uint){ t = a + b; emit L(a, b, msg.sender); return a ..
function bytes32ToString(bytes32 x) constant returns (string) { bytes memory bytesString = new bytes(32); uint charCount = 0; for (uint j = 0; j < 32; j++) { byte char = byte(bytes32(uint(x) * 2 ** (8 * j))); if (char != 0) { bytesString[charCount] = char; charCount++; } } bytes memory bytesStringTrimmed = new bytes(charCount); for (j = 0; j < charCount; j++) { bytesStringTrimmed[j] = bytesStrin..