일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- erc4337
- Vue
- 컨트렉트 동일한 함수이름 호출
- ethers websocket
- rust 기초
- erc4337 contract
- 스마트 컨트렉트 함수이름 중복
- 오블완
- 머신러닝기초
- 스마트컨트렉트 예약어 함수이름 중복
- 러스트 기초
- 러스트기초
- SBT표준
- ethers v6
- ethers
- vue기초
- ambiguous function description
- chainlink 설명
- ethers type
- 계정추상화
- 컨트렉트 배포 자동화
- Vue.js
- 스마트컨트렉트테스트
- multicall
- git rebase
- ethers typescript
- 체인의정석
- 러스트 기초 학습
- 티스토리챌린지
- 스마트컨트렉트 함수이름 중복 호출
- Today
- Total
체인의정석
solidity에서의 bytes32 자료형에 대하여 본문
폴리곤의 pos 브릿지에서는 토큰의 타입등과 같이 이벤트로 남기는 값에 있어서 주소값을 제외하고는 bytes32를 남긴다.
이에 대해 찾아보니 bytes32는 일반 byte에 비하여 용량을 적게 사용한다고 한다. 가스비를 최대한 줄여야 하기 때문에 bytes32를 자주 쓰는것으로 보인다.
다음은 이더리움에 있는 테더의 주소이다.
https://etherscan.io/address/0xdAC17F958D2ee523a2206206994597C13D831ec7#code
Tether: USDT Stablecoin | 0xdAC17F958D2ee523a2206206994597C13D831ec7
The Contract Address 0xdAC17F958D2ee523a2206206994597C13D831ec7 page allows users to view the source code, transactions, balances, and analytics for the contract address. Users can also interact and make transactions to the contract directly on Etherscan.
etherscan.io
이 테더의 주소를 pos 브릿지의 매핑에 대입을 해보겠다.
https://etherscan.io/address/0xa0c68c638235ee32657e8f720a23cec1bfc77c77#readProxyContract
Polygon (Matic): Bridge | 0xa0c68c638235ee32657e8f720a23cec1bfc77c77
The Contract Address 0xa0c68c638235ee32657e8f720a23cec1bfc77c77 page allows users to view the source code, transactions, balances, and analytics for the contract address. Users can also interact and make transactions to the contract directly on Etherscan.
etherscan.io
다음과 같이 bytes32가 나옴을 알 수 있다.
https://web3-type-converter.onbrn.com/
Web3 Type Converter - Convert from bytes32 to string
Web3 Type Converter Convert from a bytes32/hex into a string/number or vice-versa. Convert to: bytes32/hex number/decimal string/utf-8/ascii These conversions happen in your browser. No data is stored.
web3-type-converter.onbrn.com
bytes32는 위의 사이트에서 변환이 가능하다.
추가적으로 솔리디티에서 "0x1"과 같이 지정을 해주어야 자료형이 지정된다. 보통 입력값을 받아오지만 나는 constructor 부분에서 기록할 내용이 있어 사용하게 되었다.