3

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?

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?

address.transfer()

  • throws on failure
  • forwards 2,300 gas stipend, safe against reentrancy
  • should be used in most cases as it's the safest way to send ether

address.send()

  • returns false on failure
  • forwards 2,300 gas stipend, safe against reentrancy
  • should be used in rare cases when you want to handle failure in the contract

address.call.value().gas()()

  • returns false on 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
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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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