mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
2e2094ad82
The docs state that a plain `address` cannot be sent Ether. But even though `send` and `transfer` members are not available for plain `address`, the `call` is. And `call` can be invoked upon a plain `address` type to send Ether to the address. For instance, the `someone` (`address` type) can be sent Ether by invoking `sendSomeone()` method in the following `Dummy` contract: ``` contract Dummy { address someone = 0xAb8...cb2; function balanceOf(address addr) public view returns (uint) { return addr.balance; } function sendToSomeone() public payable returns (bool) { (bool sent, ) = someone.call{value: msg.value}(""); return sent; } } ``` |
||
---|---|---|
.. | ||
conversion.rst | ||
mapping-types.rst | ||
operators.rst | ||
reference-types.rst | ||
value-types.rst |