Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion contracts/crowdsale/Crowdsale.sol
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ contract Crowdsale {
uint256 weiAmount = msg.value;

// calculate token amount to be created
uint256 tokens = weiAmount.mul(rate);
uint256 _rate = getRate(beneficiary, weiAmount, now);
uint256 tokens = weiAmount.mul(_rate);

// update state
weiRaised = weiRaised.add(weiAmount);
Expand All @@ -83,6 +84,12 @@ contract Crowdsale {

forwardFunds();
}

// low level get rate function
// override to create custom rate function, like giving bonus for early contributors or whitelist addresses
function getRate(address beneficiary, uint256 weiAmount, uint256 time) returns (uint256){
return rate;
}

// send ether to the fund collection wallet
// override to create custom fund forwarding mechanisms
Expand Down