Can someone help me and tell me where in my code is the problem. How to fix this ?
https://ropsten.etherscan.io/tx/0xbd2079c12f90bb9396d79e7aeb5b5914472dd25c9e62ce36ffa85f6e88d7b594
Is there any obvious error ? Help is more than appreciate.Robert
Can someone help me and tell me where in my code is the problem. How to fix this ?
https://ropsten.etherscan.io/tx/0xbd2079c12f90bb9396d79e7aeb5b5914472dd25c9e62ce36ffa85f6e88d7b594
Is there any obvious error ? Help is more than appreciate.Robert
When sending ether to the contract address it would call this function in your contract:
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();
}
}
The transaction would be reverted if either:
token.approve("0x4927f2ad....", amount, { from: "0xOwnerAddress" });