일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 contract
- Vue.js
- 스마트컨트렉트테스트
- 스마트컨트렉트 함수이름 중복 호출
- 티스토리챌린지
- ethers websocket
- 스마트 컨트렉트 함수이름 중복
- ethers type
- 러스트 기초
- ambiguous function description
- 머신러닝기초
- multicall
- 러스트기초
- chainlink 설명
- rust 기초
- SBT표준
- Vue
- 컨트렉트 배포 자동화
- erc4337
- ethers v6
- 오블완
- vue기초
- 체인의정석
- ethers typescript
- ethers
- git rebase
- 러스트 기초 학습
- 스마트컨트렉트 예약어 함수이름 중복
- Today
- Total
목록블록체인 (225)
체인의정석
과거 특정 시점에서의 특정 값을 조회 할 때 이벤트 말고도 조회가 가능한 방법이 있다. 바로 조회 함수에 특정 블록번호를 넣어주는 블록태그 blocktag이다. https://github.com/ethers-io/ethers.js/blob/ab319f2f4c365d4cd1b1e17e577ecd18a7a89276/packages/contracts/src.ts/index.ts#L33 GitHub - ethers-io/ethers.js: Complete Ethereum library and wallet implementation in JavaScript. Complete Ethereum library and wallet implementation in JavaScript. - GitHub - ethers-io..
web3의 getPastEvents를 ethers에서 하려면 "query filter"를 사용하면 된다고 한다. 이걸 못찾아서 노가다를 했었는데 앞으로 이걸써야지 https://docs.ethers.org/v5/api/contract/contract/#Contract-queryFilter Contract Documentation for ethers, a complete, tiny and simple Ethereum library. docs.ethers.org // Get the address of the Signer myAddress = await signer.getAddress() // '0x8ba1f109551bD432803012645Ac136ddd64DBA72' // Filter for all to..
erc20토큰을 전송 하면 nft가 민팅 되는 구조를 만들고 있었는데 문제가 발생하였다. 평소에는 async function pushETHwithdraw(erc20Token, myAddress, provider, abi) { clientsETH = [] console.log("pushETHwithdraw") const resObj = {} const topic = [erc20Token.filters.WithdrawETH().topics].toString(); const filter = { address: ERC20, fromBlock: 28546565, topics: [topic] }; const getlogs = await provider.getLogs(filter); let iface = new et..
업그레이더블 컨트렉트를 사용할 시 기존의 컨트렉트에서 추가할 점에 대해서 정리해보겠다. 1. 오픈제플린의 Initializer 또는 Owner 사용시 Ownable Upgradable을 사용한다. 이때 컨트렉트가 들어간 폴더 명은 contracts로 해줘야 오픈제플린 모듈에서 인식이 된다. 안그러면 인식을 못하니 컨트렉트가 들어있는 폴더명을 함부로 바꾸지 말자 import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; contract Example is OwnableUpgradeable { 2. constructor에는 _disableInitializer를 명시해준다. initialize가 다시 되는것을 방지해 주는 것이다. /..
solidity에서 만약 자료형을 넣어서 에러메세지를 주고 싶다면 에러를 정의한 후 revert를 해주면 된다. // SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.10; error InvalidNumber(uint32 required, uint32 passed); contract CustomErrors{ uint32 private constant magicNumber = 42; function checkMagicNumber(uint32 _number) public pure { if (_number != magicNumber) revert InvalidNumber({ required: magicNumber, passed: _number }); // ..

이번에 컨트렉트를 작성하면서 변수명에서 그냥 address가 아닌 CToken cTokenAddress 이런방식의 파라미터가 함수에 쓰이는 경우를 보았다. 이런경우 인터페이스를 작성할 때 Storage 부분을 컨트렉트 형태로 먼저 작성한 후에 contract CTokenStorage { /** * @dev Guard variable for re-entrancy checks */ bool internal _notEntered; /** * @notice EIP-20 token name for this token */ string public name; /** * @notice EIP-20 token symbol for this token */ string public symbol; /** * @notice ..
EVM 체인을 포크해서 사용하는 경우에 에러 메세지가 안뜨는 경우가 종종 발생합니다. 이때 estimateGas를 쓰게 되면 에러 메세지를 확인할 수 있습니다. (물론 과거 상황의 에러의 경우 estimateGas를 그때 시점에서 하는 것이 아니기에 안되는 케이스도 존재합니다.) 따라서 현재 트랜잭션에서 에러가 발생했는데 tenderly나 이더스캔에서 작동을 하지 않는 경우에 에러 메세지 확인하는 법에 대해서 정리해보았습니다. 1. 원하는 네트워크 환경으로 콘솔 들어가기 먼저 에러 코드를 확인할 testNetwork 에 맞춰서 하드햇 콘솔을 띄웁니다. 그럼 콘솔창에 들어가집니다. npx hardhat console --network testNetwork 2. 콘솔에서 트랜잭션 가져오고 gasPrice 제..
hardhat node 버전 맞추기 먼저 버전을 맞추는 방법은 아래와 같다. curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash nvm install 18 nvm use 18 nvm alias default 18 npm install npm --global # Upgrade npm to the latest version 첫번째 명령어를 실행시키고 터미널을 닫은 후 다시 켜야 제대로 인식이 된다. 현재 hardhat은 18버전이 정식이라고 하니 버전이 19일 경우 18로 내리면 좋다. 여러 컨트렉트 소스 한번에 컴파일하기 1. 먼저 기본 경로인 contract 안에 프로젝트 별로 폴더를 만든다. 2. 각 프로젝트 별..