참고
- https://ethereum.stackexchange.com/questions/5992/how-much-computation-can-be-done-in-a-fallback-function
- https://bitcoin.stackexchange.com/questions/39132/what-is-gas-limit-in-ethereum
sending a transaction costs 21000 gas
A recipient contract's fallback function only gets a 2300 gas stipend if it was invoked with recipient.transfer or recipient.send
fallback 함수가 호출되는 여러 경우가 있는데 그 중 receiver.send 함수 또는 receiver.transfer 함수로 인해 receiver의 fallback 함수가 호출된다. 이 때 fallback 함수 호출과 함께 2300gas를 봉급으로 주어지게 된다.
This is the same as an external account paying recipient with web3.eth.sendTransaction({to:recipient, gas:21000, ...}).
To obtain the same effects (2300 gas stipend), callers must explicitly limit the gas to zero when invoking the recipient by: recipient.call.gas(0).value(...)
fallback 함수에 봉급받은 2300gas가 있기 때문에 recipient.call.gas(0).value(...)을 호출해도 2300gas를 이용해 fallback에서 send, 또는 transfer 함수를 처리할 있다.