I was reading this article about Crowdsale.

Simply, 100 Tokens are to be minted. The author set 60% of tokens are distributed as public sale. To be more specific, 20 out of 60 tokens will be sold during PreICO and 40 out of 60 will be sold during ICO.

As per rate,

in PreICO, 1 ETH can buy 5 tokens, and

in ICO, 1 ETH can buy 2 tokens.

To summarize,

PreICO has limit up to 4 ETH (4 ETH * 5 tokens = 20 tokens), and

ICO has limit up to 20 ETH (20 ETH * 2 tokens = 40 tokens).

So in total public sale will be capped at 24 ETH, which means investors should not be able to purchase more tokens when the weiRaised reached 24 ETH.

However, the author set its hard cap at 500 ETH, but isn't it supposed to be capped at 24 ETH instead?

1 Answer 1


By having a quick look at the function () external payable it seems it doesn't implement restrictions on how much Ether can be sent (except for preICO). The implementation of buyTokens is not given so it's difficult to say if there are some restrictions there.

In general there are two types of hard caps: based on token amount and based on Ether amount. A crowdsale shouldn't need a cap based on both types - only either of them. I think Ether amount is the most typical type as creating tokens is free but you may want to restrict the amount of Ether you receive.

So even if the contract has the "wrong" Ether hard cap it is still restricted by the token amount so it doesn't really matter how high the Ether hard cap is as it can never be reached. Some might even say it's useless.

  • Ok. If ether amount is typical, does that mean the total supply cannot be pre-defined in the beginning? For example one billion tokens as max tokens
    – bbusdriver
    Jun 11, 2019 at 5:21
  • Well there is always a ratio how many tokens you get with 1 Eth so the maximum token amount can be directly calculated from that. Jun 11, 2019 at 16:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.