Hey guys :-)
Does someone of you know how I can withdraw Ether from a Smart Contract? When I use the transfer functionality, the contract seems only be able to transfer token instead of ether :-/
Jul 28, 2018, 11:26 AM
Hey, Pablo. Thanks for your response. I am currently testing out everything I can find on Google. What seems to be close, should be this:
function testPayable() public payable {
transfer(_to, msg.value);
emit Transfer(this, _to, msg.value);
}
transfer(_to, msg.value);
emit Transfer(this, _to, msg.value);
}
This should receive ether and "forward" it immediately
Only problem I have with it now is, that the gas estimation fails
Jul 28, 2018, 11:36 AM
you shoud use trasfer method of address type, for example msg.sender.transfer(_value); trasfers _value in ether(wei) to msg.sender address
Jul 28, 2018, 11:38 AM
Hey Dmitry, thanks for the heads up. I'll try this .-)
This did the job, thank you :-) when I first tried it this way, I thought it should have been like this:
sendingAddres.transfer(receivingAddres, Amount)
Thanks for showing that it is actually:
receivingAddress.transfer(amount);
:-)
sendingAddres.transfer(receivingAddres, Amount)
Thanks for showing that it is actually:
receivingAddress.transfer(amount);
:-)
yes
Jul 28, 2018, 12:41 PM