강의

멘토링

로드맵

Inflearn Community Q&A

dbsdnjs19928372's profile image
dbsdnjs19928372

asked

Creating a Blockchain Ethereum Real Estate Dapp - Basic

Listing Purchase Function

TypeError: web3.toWei is not a function

Written on

·

645

0

app.buyRealEstate(0, "yw" , 28, {from: web3.eth.accounts[1],value : web3.toWei(1.50,"ether")})

이런 에러가 나오는데 이건 버전의 문제일까요?

web3.util을 붙여도 해결 되지 않네요 ㅜㅜㅜ

dappblockchainEthereum

Quiz

52% of people got it wrong. Give it a try!

What are the advantages of using blockchain in real estate transactions?

Transaction speed is always rapid.

The record is not falsified or altered and remains permanently.

The role of the intermediary becomes more important.

All transaction information is public to everyone.

Answer 6

4

저도 web3 1.2.4 버전이라 위와 같은 오류 떴는데 해결한 방법 공유할게요.

일단 sol 파일에서 bytes32 name 을 string name으로 고치고, 콘솔에선 app.buyRealEstate(0, "sejong", 13, {from: accounts[1], value: web3.utils.toWei('1.50', "ether")}) 로 하니 트랜잭션 되더라구요.

구글링으로 어떻게든 돌아가게 만들어본거라 뒷 강의 진행하면서 string 때문에 오류날 수도 있으니 강의자님 더 정확한 방법 피드백 부탁드려요!

0

버전1.0 일 경우는 해결방법이 없는건가요...제발 알려주세요 ㅠㅠ 아무리 찾아도 안나오네요 util로 바꿔서 해도 안되고...

0

하....진짜 어떻게 바꾸나요..web3 버전....

0

web3 버전 어떻게 바꾸나요?ㅠㅠ

0

dbsdnjs19928372님의 프로필 이미지
dbsdnjs19928372
Questioner

감사합니다!

0

SEJONG IT EDU님의 프로필 이미지
SEJONG IT EDU
Instructor

혹시 web3.js 1.0 버전 쓰시나요? 0.x.x 버전 쓰셔야 강좌와 맞게 가실 수 있어요!

dbsdnjs19928372's profile image
dbsdnjs19928372

asked

Ask a question