August 2019
Intermediate to advanced
486 pages
13h 52m
English
The syntax for using send is as follows:
<address>.send(uint256 amount) returns (bool)
The .send() function is used to send ether units in wei to another external account or contract account. This is same as the address.transfer function call. The only difference is that this call returns a bool result to indicate that the .send operation succeeded or not. The execution does not stop when the .send call fails, and the return value is not validated.
If the .send operation fails for whatever reason, it will always return false as a result, but the call itself will not throw and revert the transaction on its own.
It is the developer's responsibility to check for the return value and take action accordingly. There are ...