有人能帮我,告诉我代码中哪里是问题所在吗?怎么解决这个问题?
https://ropsten.etherscan.io/tx/0xbd2079c12f90bb9396d79e7aeb5b5914472dd25c9e62ce36ffa85f6e88d7b594
有明显的错误吗?帮助不仅仅是appreciate.Robert
发布于 2018-04-09 22:19:54
当将以太发送到合同地址时,它将在您的合同中调用此函数:
function () payable whenNotPaused beforeDeadline afterStartTime saleNotClosed {
require(msg.value >= minContribution);
// Update the sender's balance of wei contributed and the amount raised
uint amount = msg.value;
uint currentBalance = balanceOf[msg.sender];
balanceOf[msg.sender] = currentBalance.add(amount);
amountRaised = amountRaised.add(amount);
// Compute the number of tokens to be rewarded to the sender
// Note: it's important for this calculation that both wei
// and PDT have the same number of decimal places (18)
uint numTokens = amount.mul(rate);
// Transfer the tokens from the crowdsale supply to the sender
if (tokenReward.transferFrom(tokenReward.owner(), msg.sender, numTokens)) {
FundTransfer(msg.sender, amount, true);
// Check if the funding goal or cap have been reached
// TODO check impact on gas cost
checkFundingGoal();
checkFundingCap();
}
else {
revert();
}
}如果下列任何一种方式之一,交易将被恢复:
https://ethereum.stackexchange.com/questions/45158
复制相似问题