| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 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 |
- 티스토리챌린지
- redux toolkit 설명
- erc4337 contract
- Vue.js
- 러스트기초
- 머신러닝기초
- Vue
- erc4337
- ethers typescript
- 컨트렉트 동일한 함수이름 호출
- 스마트컨트렉트 예약어 함수이름 중복
- git rebase
- 러스트 기초
- 체인의정석
- ethers type
- redux 기초
- 러스트 기초 학습
- 스마트 컨트렉트 함수이름 중복
- rust 기초
- SBT표준
- cloud hsm 서명
- 스마트컨트렉트 함수이름 중복 호출
- ethers v6
- 오블완
- cloud hsm
- 계정추상화
- cloud hsm 사용하기
- ambiguous function description
- ethers websocket
- vue기초
- Today
- Total
목록전체 글 (530)
체인의정석
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..
ERC721 Receiver /** * @dev Internal function to invoke `onERC721Received` on a target address. * The call is not executed if the target address is not a contract. * * This function is deprecated. * @param from address representing the previous owner of the given token ID * @param to target address that will receive the tokens * @param tokenId uint256 ID of the token to be transferred * @param _d..
ERC721에서 token URI는 토큰아이디와 base URI의 조합으로 만들어 진다. IERC721Metadata.sol function tokenURI(uint256 tokenId) external view returns (string memory); ERC721.sol /** * @dev See {IERC721Metadata-tokenURI}. */ function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { require(_exists(tokenId), "ERC721Metadata: URI query for nonexistent token"); string memory baseURI = _base..
