답변 2
1
안녕하세요.
보내주신 에러를 보니 this.lotteryContract.methods.betAndDistribute('0xcd').send({from:this.account, value:.....} 부분에서 this.account에 적절한 이더리움 주소가 들어가있지 않은 것 처럼 보이는데요.
initWeb3 함수의 아랫 부분에
let accounts = await this.web3.eth.getAccounts();
this.account = accounts[0];
this.lotteryContract = new this.web3.eth.Contract(lotteryABI, lotteryAddress);
위와 같은 코드를 작성하셨으면 this.account에 from 으로 사용할 이더리움 주소가 들어가게 됩니다.
이 부분이 잘 작성되었는지 확인해주세요.
0