Does address.send(0)
makes an actual message call forwarding some small amount of gas(2300?) to fallback function or does it simply return false
without making a message call to another contract? It wouldn't be unreasonable to assume that EVM detects 0 value and simply returns false, because what's the point of making a call in this case if there's nothing to send?
I'm asking this, because I want to understand how this example from a post on security works
contract auction {
address highestBidder;
uint highestBid;
mapping(address => uint) refunds;
function bid() {
if (msg.value < highestBid) throw;
if (highestBidder != 0)
refunds[highestBidder] += highestBid;
highestBidder = msg.sender;
highestBid = msg.value;
}
function withdrawRefund() {
uint refund = refunds[msg.sender];
refunds[msg.sender] = 0;
if (!msg.sender.send(refund))
refunds[msg.sender] = refund;
}
}