A basic question on how zepplin solidity code calculates token rates. The code comments say
// how many token units a buyer gets per wei
uint256 public rate;
however we cannot get it to serve back 1000 tokens per ETH when we pass an ammount as the rate into;
function Crowdsale(uint256 _startTime, uint256 _endTime, uint256 _rate, address _wallet) {
require(_startTime >= now);
require(_endTime >= _startTime);
require(_rate > 0);
require(_wallet != address(0));
token = createTokenContract();
startTime = _startTime;
endTime = _endTime;
rate = _rate;
wallet = _wallet;
}
the rate is used in;
uint256 weiAmount = msg.value;
// calculate token amount to be created
uint256 tokens = weiAmount.mul(rate);
Again, whatever rate we send in, high or low does not come out at 1,000 tokens per eth.
can anyone explain the working of this calculation so we can get there?
Thanks