function safeWithdrawal() public afterDeadline {
if (!fundingGoalReached) {
uint amount = balanceOf[msg.sender];
balanceOf[msg.sender] = 0;
if (amount > 0) {
if (msg.sender.send(amount)) { //is this a condition or a command?
emit FundTransfer(msg.sender, amount, false);
} else {
balanceOf[msg.sender] = amount;
}
}
}
I was studying this code: https://www.ethereum.org/crowdsale and there was a part I didn't quite understand (see code above). My question is how does the contract iterate over every address that sent money to the contract and send it back... I can't see that in the code above. Also what does this condition (see code below) mean? From what I understand it looks like a command not a condition.
msg.sender.send(amount)
Also How do you create a smart contract that receives funds, displays the addresses that sent the funds to the client? Like if in the crowdfunding dapp you would like to publicly display the addresses and how much they sent and even when they sent the funds.