PatrickAlphaC / brownie_fund_me

26 stars 64 forks source link

Compiler error #56

Open MrPotatoHead-Dev opened 1 year ago

MrPotatoHead-Dev commented 1 year ago

hi,

I keep getting this error:

CompilerError: solc returned the following errors:

Warning: Visibility for constructor is ignored. If you want the contract to be non-deployable, making it "abstract" is sufficient. --> contracts/FundMe.sol:19:5: | 19 | constructor(address _priceFeed) public { | ^ (Relevant source part starts here and spans across multiple lines).

TypeError: "send" and "transfer" are only available for objects of type "address payable", not "address". --> contracts/FundMe.sol:70:9: | 70 | msg.sender.transfer(address(this).balance); | ^^^^^^^^^^^^^^^^^^^

I was getting the standard compile error for using pragma ^0.6.0 so I changed it to ^0.6.6 then I got another error + this one so I changed the compiler again to 0.8.17 and that narrowed my error to only this one. I pasted Pattys scripts to check but I still got this error

MrPotatoHead-Dev commented 1 year ago

After further reading I noticed If I change msg.sender.transfer(address(this).balance); to: payable(msg.sender).transfer(address(this).balance);

It works fine now