I can receive ETH and transfer to owner via:

function () payable {
    owner.transfer(msg.value); // owner = address of owner

How can I have a function which does the reverse thing? Take ETH from owner and transfer to msg.sender?

2 Answers 2


You can't take Eth from anyone. The contract has only access to Ether which is stored inside the contract. So the owner has to send Ether to the contract which the contract can then send to wherever (for example msg.sender in another function call).


using smart contract to transfer from user address to smart contract address and transfer ETH to the address which you want with:

function withdraw(address _to) public {

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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