| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 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
- 티스토리챌린지
- 계정추상화
- ambiguous function description
- Vue.js
- redux 기초
- 머신러닝기초
- cloud hsm 서명
- 러스트 기초 학습
- cloud hsm
- git rebase
- cloud hsm 사용하기
- 러스트 기초
- 체인의정석
- ethers type
- 컨트렉트 동일한 함수이름 호출
- erc4337 contract
- SBT표준
- 스마트컨트렉트 예약어 함수이름 중복
- 러스트기초
- ethers v6
- Vue
- rust 기초
- 오블완
- ethers typescript
- redux toolkit 설명
- Today
- Total
목록분류 전체보기 (532)
체인의정석
만약 로컬테스트에서는 통과를 했는데 메인넷 테스트에서 실패를 한다면? 함수를 실행하고 조회하기까지 어느정도의 시간을 넣어주어야 에러가 안 나는 경우도 있다. await bridge.setCustody(erc721Custody.address,tokenType721); await delay(15000); console.log("getCustody address",await bridge.typeToCustody(tokenType721)); function delay(ms: number) { return new Promise( resolve => setTimeout(resolve, ms) ); } 위와 같이 setCustody 함수를 실행하자마자 바로 그 결과값을 확인한다면 결과 값이 반영이 되기 전이라 조회가..
테스트 코드를 한창 쓰고 있는데 Error: VM Exception while processing transaction: reverted with reason string 'ERC721: owner query for nonexistent token' 위와 같은 에러가 났다. 문제는 해당 에러는 여기저기에 다 분포되어 있기 때문에 컨트렉트와 테스트 스트립트 곳곳에 로그를 찍으면서 모두 확인해보았다. import "hardhat/console.sol"; . . . . function ownerOf(uint256 tokenId) public view returns (address) { address owner = _tokenOwner[tokenId]; console.log("owner OF >>>>", tok..
safeTransferFrom 같은 경우 ERC721 onRECEIVE를 상속 받았는지 여부를 체크해 준다. 스마트컨트렉트가 받는 주소라면 이렇게 transferFrom을 사용하여야지 안에 토큰들이 갇히는 걸 방지할 수 있다. 기본적으로 오픈제플린에서 상속을 받으면 safeTransferFrom 이 적용된다. 하지만 직접적으로 토큰을 다루는 컨트렉트 들은 function onERC721Received( address, address, uint256, bytes memory ) public returns (bytes4) { return this.onERC721Received.selector; } "IERC721Receiver" 인터페이스를 상속 받은 후 위와 같이 오버라이딩 해주어야 한다. 위는 0.5.0..
스마트 컨트렉트에서 데이터를 암호화하여 올리기 위하여 uint256 tokenId = abi.decode(bytes(tokenData),(uint256)); 다음과 같이 solidity에서 abi.encode 해온 값을 받아와서 decode 하는 코드가 들어갈 때가 있다. 이럴 때는 etherjs에 있는 abiCoder를 사용하여 입력값을 주어 테스트 할 수 있다. https://docs.ethers.io/v5/api/utils/abi/coder/#AbiCoder-encode AbiCoder Documentation for ethers, a complete, tiny and simple Ethereum library. docs.ethers.io 위와 같이 abicoder를 사용하면 해결이 가능한데 con..
컨트렉트에서 특정 데이터를 기록할 때 종종 keccack256의 해시 값을 저장시킨다. _tokenType = keccak256(abi.encodePacked("erc721")); 위에는 솔리디티의 코드인데, 다음과 같이 erc721 종류의 토큰을 나타내기 위해 사용하는 경우이다. 여러 토큰을 다루어야 하는 dapp이다 보니 위와 같은 표시를 남기게 되고 이를 체크하여 다양한 종류의 표준 토큰을 관리하는것이 목적인 상황이다. 테스트를 하거나 스크립트를 짤 때 이러한 점을 고려하여 keccak256을 사용해야 할 상황이 있다. 먼저 ethers에 나오는 keccak을 하는 방법이다. const tokenType721 = await ethers.utils.keccak256(ethers.utils.toUtf8..
const paddedOriginChain = ethers.utils.hexZeroPad("0x1", 32) => paddedOriginChain >>> 0x0000000000000000000000000000000000000000000000000000000000000001
nft에 있는 token URI는 앞부분은 다음과 같이 오픈제플린 표준에 있는 인터페이스방식대로 가져오면 된다. // override external view function tokenURI(uint256 tokenId) external view returns (string memory) { require(_exists(tokenId), "ERC721Metadata: URI query for nonexistent token"); string memory baseURI = getBaseURI(); return bytes(baseURI).length > 0 ? string(abi.encodePacked(baseURI, tokenId.toString())) : ""; } function getBaseURI()..
코드 리뷰 때 모든 코멘트를 싱글로 달면 메일이 계속 날라가서 다음과 같이 변경하였다. https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/commenting-on-a-pull-request Commenting on a pull request - GitHub Docs You can comment on a pull request's Conversation tab to leave general comments, questions, or props. You can also suggest changes that the author of the pull request ca..
