| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 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 |
- cloud hsm 서명
- ambiguous function description
- erc4337
- 러스트 기초 학습
- erc4337 contract
- 러스트기초
- 스마트컨트렉트 함수이름 중복 호출
- 스마트 컨트렉트 함수이름 중복
- Vue
- 계정추상화
- 체인의정석
- cloud hsm 사용하기
- redux 기초
- rust 기초
- 컨트렉트 동일한 함수이름 호출
- vue기초
- 머신러닝기초
- ethers type
- 스마트컨트렉트 예약어 함수이름 중복
- redux toolkit 설명
- 티스토리챌린지
- SBT표준
- Vue.js
- ethers websocket
- ethers v6
- 러스트 기초
- git rebase
- ethers typescript
- 오블완
- cloud hsm
- Today
- Total
목록전체 글 (531)
체인의정석
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..
먼저 아래 링크의 문서를 통하여 테스트 코드를 작성하기로 해보았다. https://ethereum-waffle.readthedocs.io/en/latest/getting-started.html Getting Started — waffle documentation After you have successfully authored a Smart Contract you can now think about testing it. Fortunately for you, Waffle is packed with tools that help with that. Tests in waffle are written using Mocha alongside with Chai. You can use a different test e..
생성자로 코드 형태인 bytes32를 넣어야 하는 상황이다. 그러나 "0x1"과 같이 바로 사용하면 오류가 났다. 찾아보니 bytes32에 패딩작업을 해주지 않으면 오류가 난다고 한다. 따라서 패딩작업을 해주는 함수를 찾아서 적용하였다. const paddedA = ethers.utils.hexZeroPad("0x1", 32) const paddedB = ethers.utils.hexZeroPad("0x2", 32) 이런식으로 0을 채워서 숫자를 맞추어 주어야 32 바이트의 인자값이 나오게 된다. 32byte의 경우 고정 길이로서 외부함수 호출등에도 사용이 가능하며 용량을 작게 차지하여서 특정 인덱스 정보를 저장하는데 용이하다. 여기서는 ERC 토큰의 표준이나 체인의 아이디와 같은 값을 byte32로 지..
다음과 같이 오류가 나서 한참을 해메었다. https://forum.openzeppelin.com/t/you-are-trying-to-create-a-contract-factory-for-the-contract-which-is-abstract-and-cant-be-deployed/11730/3 You are trying to create a contract factory for the contract, which is abstract and can't be deployed Hello @mansijoshi17 if the compiler forces the contract to be marked as an abstract contract, that is because there are function th..
https://docs.soliditylang.org/en/v0.5.0/contracts.html?highlight=constructor#constructors Contracts — Solidity 0.5.0 documentation Contracts in Solidity are similar to classes in object-oriented languages. They contain persistent data in state variables and functions that can modify these variables. Calling a function on a different contract (instance) will perform an EVM function cal docs.solid..
솔리디티 자료형을 다루다 보니 bytes와 bytes32에 대한 혼동이 있어 정리를 하였다. 우선 결과만 말하자면 bytes는 byte[]와 같은 의미를 가진다. bytes32는 고정길이 배열이기 때문에 컨트렉트 안과 밖 사이의 전달이 가능하다는 점이다. 가변 길이의 배열은 interface나 ABI가 지원을 하지 않기 때문에 사용할 수가 없다. web3에서 컨트렉트의 전송은 가능하지만 컨트렉트끼리의 전송은 되지 않는다고 보면 된다. 또한 고정이 아닌 가변 길이 베열의 경우 memory를 변수 앞에 넣어주어야 에러가 나지 않는다. 결론 1. 사이즈가 작아도 되는 경우 bytes32 사용 2. 외부호출에 쓰이는 경우 bytes32 사용 3. 사이즈가 큰 경우 byte 사용 https://ethereum.s..
memory (whose lifetime is limited to a function call) storage (the location where the state variables are stored) calldata (special data location that contains the function arguments, only available for external function call parameters). https://ethereum.stackexchange.com/questions/63247/calldata-keyword-as-parameter-in-solidity-v0-5-0-function calldata keyword as parameter in solidity v0.5.0 f..
인터페이스는 external로 정의를 한다. 이 경우 상속을 받으면 불러오거나 사용이 불가능하다. 따라서 상속을 해오지 않고 인터페이스를 import 만 해서 사용한다. 만약 인터페이스를 import 하는 경우 덮어써서 사용하는 방법인데 0.5.0 버전까지는 같은 이름으로 다시 작성을 하면 되며 다른것은 override 변수를 씌워주어야 한다. 인터페이스의 경우 활용법이 매우 햇갈리는것 같은데 정리된 사항은 다음과 같다. 1. 인터페이스의 경우 external로 통일한다. 2. 인터페이스의 경우 상속을 하면 오버라이딩을 통하여 사용을 한다. 3. 상속을 하지 않고 import만 하는 경우 함수 그대로 다른 컨트렉트의 주소를 넣어서 외부 호출을 할 때 사용한다. 4. 컨트렉트의 효율성을 위하여 하위 단계의..
