I am quite new to solidity, and I have not managed to find a solution for this problem.

I am passing the function an address but it says the following: "Invalid type for argument in function call. Invalid implicit conversion from address to address payable request."

address admin;

function endSale() public {
 require(msg.sender == admin);

As of Solidity 0.5.0, there are two different address types in solidity: address and address payable.

You can only transfer funds to an address payable.

Therefore, your problem will be fixed by making admin an address payable:

address payable admin;
|improve this answer|||||

You can cast to address payable with this code:


Solidity 0.6.x update:

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.