IncreasingPriceCrowdsale
contract IncreasingPriceCrowdsale
Extension of Crowdsale contract that increases the price of tokens linearly in time. Note that what should be provided to the constructor is the initial and final _rates_, that is, the amount of tokens per wei contributed. Thus, the initial rate must be greater than the final rate.
Reference
Functions
_getTokenAmount
function _getTokenAmount(uint256 _weiAmount) internal view returns (uint256)
Overrides parent method taking into account variable rate.
- Parameters:
_weiAmount
- The value in wei to be converted into tokens- Returns:
- The number of tokens _weiAmount wei will buy at present time
fallback
function (uint256 _initialRate, uint256 _finalRate) public
Constructor, takes intial and final rates of tokens received per wei contributed.
- Parameters:
_initialRate
- Number of tokens a buyer gets per wei at the start of the crowdsale_finalRate
- Number of tokens a buyer gets per wei at the end of the crowdsale
getCurrentRate
function getCurrentRate() public view returns (uint256)
Returns the rate of tokens per wei at the present time. Note that, as price _increases_ with time, the rate _decreases_.
- Returns:
- The number of tokens a buyer gets per wei at a given time