I have been trying to get documentation for address.send() function, but i am unable to do so. Can someone please explain how address.send() function works, and how it can be used to send currency from one account to other?
Asked
Active
Viewed 806 times
2 Answers
3
send() will be deprecated in the future in favor of transfer(). You can read about the differences in this answer <address>.send vs <address>.transfer best practice usage?
- throws on failure
- forwards
2,300gas stipend, safe against reentrancy- should be used in most cases as it's the safest way to send ether
- returns
falseon failure- forwards
2,300gas stipend, safe against reentrancy- should be used in rare cases when you want to handle failure in the contract
- returns
falseon failure- forwards all available gas, allows specifying how much gas to forward
- should be used when you need to control how much gas to forward when sending ether or to call a function of another contract
medvedev1088
- 10,996
- 5
- 35
- 63
1
Go down to the part about send http://solidity.readthedocs.io/en/develop/types.html essentially it just sends Ether to the address that you choose, inside of the brackets you choose how much Ether you would like to send. You would use it in a Solidity smart contract to send Ether out of the contract to a chosen address.
JAG
- 494
- 1
- 3
- 12
address.callis that it add padding to the parameters https://github.com/ethereum/solidity/issues/2884 and that can cause some issues. – Ismael Feb 21 '18 at 05:30