강의

멘토링

커뮤니티

Inflearn Community Q&A

titkyh6880's profile image
titkyh6880

asked

Creating a Blockchain Ethereum Real Estate Dapp - Basic

Listing Purchase Function

"send" and "transfer" are only available for objects of type "address payable", not "address". 오류

Written on

·

503

0

function buyRealEstate(uint _id, bytes32 _name, uint _age) public payable {

require(_id >= 0 && _id <= 9);

buyers[_id] = msg.sender;

buyerInfo[_id] = Buyer(msg.sender, _name, _age);

owner.transfer(msg.value);

}

함수에서 onwer.transfer(....); 에 오류가 아래와 같은 오류가 납니다.

"send" and "transfer" are only available for objects of type "address payable", not "address".

blockchaindappEthereum

Answer 3

3

혹시 이 에러 뜨시는 분들은 일단 무시하고 컴파일 진행하시면 정상적으로 작동하니 참고하세요~!

그렇네요! 무시하고 하니까 잘 됩니다 ㅎㅎ

2

address(uint160(owner)).transfer(msg.value); 이렇게 바꾸시면 실행되는거 같아요!

0

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

트러플 버전이 혹시 4.1.15인거 맞나요?

titkyh6880's profile image
titkyh6880

asked

Ask a question