일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- git rebase
- vue기초
- rust 기초
- 티스토리챌린지
- ethers type
- 컨트렉트 배포 자동화
- multicall
- 러스트기초
- ethers websocket
- erc4337
- ambiguous function description
- 계정추상화
- ethers
- ethers v6
- chainlink 설명
- 러스트 기초 학습
- 오블완
- ethers typescript
- 스마트 컨트렉트 함수이름 중복
- Vue
- 컨트렉트 동일한 함수이름 호출
- 스마트컨트렉트 함수이름 중복 호출
- SBT표준
- 체인의정석
- 스마트컨트렉트 예약어 함수이름 중복
- 머신러닝기초
- Vue.js
- 스마트컨트렉트테스트
- 러스트 기초
- erc4337 contract
Archives
- Today
- Total
체인의정석
solidity error : reverted with panic code 0x32, 동적 배열 사용시 발생하는에러 본문
블록체인/Solidity
solidity error : reverted with panic code 0x32, 동적 배열 사용시 발생하는에러
체인의정석 2024. 1. 12. 16:48728x90
반응형
Error: VM Exception while processing transaction: reverted with panic code 0x32 (Array accessed at an out-of-bounds or negative index)
해당 에러는 solidity에서 동적 배열안에 인덱스를 걸어서 요소를 넣을 때 발생한다.
Error: VM Exception while processing transaction: reverted with panic code 0x32 (Array accessed at an out-of-bounds or negative
In the process of updating sushiswap contracts to solidity 8 I run into this issue while running this test accompanied by this contract. Here is the error in full: Set Should revert...
ethereum.stackexchange.com
waves[count] = msg.sender; //틀린예시
waves.push(msg.sender); //맞는예시
동적 배열을 쓸때는 다음과 같이 push를 쓰거나
최대값 또는 넉넉한 값을 넣어서 미리 배열을 만들어 두어 정적배열로 만든 후에 인덱스를 걸어서 요소를 넣으면된다.
728x90
반응형
'블록체인 > Solidity' 카테고리의 다른 글
create2 & create3에서의 Owner msg.sender 처리 (0) | 2024.03.28 |
---|---|
Solidity에서 bytes, bytes32 console.log로 찍는법 (0) | 2024.02.26 |
SyntaxError: Identifier expected. 'const' is a reserved word that cannot be used here. 에러 해결 (1) | 2024.01.08 |
Solidity Create와 Create2 (0) | 2024.01.08 |
Types in storage containing (nested) mappings cannot be assigned to. (0) | 2023.12.29 |
Comments