6

If my dapp sends ether to another address via the send() method is it not vulnerable for the recursive call attack due to the limited amount of gas of 21000? Or should I still take precautions?

eth
  • 85,679
  • 53
  • 285
  • 406
Mick de Graaf
  • 667
  • 5
  • 8

1 Answers1

6

.send will only provide 2300 gas to the fallback function and is safe. But you should carefully check and handle the return value of .send, because of the "call depth attack": How does the stack depth attack make a send() silently fail? and another example.


Note: "recursive call attack" is ambiguous because I think you mean a "reentrant attack" (but the "call depth attack" can be performed with recursive calls.)

eth
  • 85,679
  • 53
  • 285
  • 406