---
title: "Comment by Igor Yalovoy on \"The 2018 guide to writing (and testing) real world crowdsale contracts\" | Hashnode"
description: "if ((stage == CrowdsaleStage.PreICO) &amp;&amp; (token.totalSupply() + tokensThatWillBeMintedAfterPurchase &gt; totalTokensForSaleDuringPreICO)) { msg.sender.tr"
url: "https://hashnode.com/posts/the-2018-guide-to-writing-and-testing-real-world-crowdsale-contracts/5a67bb65357c012503a334c9/comment/5b63332bc4c0397e69370681"
---

[Discussion](https://hashnode.com/posts/the-2018-guide-to-writing-and-testing-real-world-crowdsale-contracts/5a67bb65357c012503a334c9)

Comment [The 2018 guide to writing (and testing) real world crowdsale contracts](https://hashnode.com/posts/the-2018-guide-to-writing-and-testing-real-world-crowdsale-contracts/5a67bb65357c012503a334c9)

[Igor Yalovoy](https://hashnode.com/@ylv)

[Aug 2, 2018](https://hashnode.com/posts/the-2018-guide-to-writing-and-testing-real-world-crowdsale-contracts/5a67bb65357c012503a334c9/comment/5b63332bc4c0397e69370681)

```
if ((stage == CrowdsaleStage.PreICO) && (token.totalSupply() + tokensThatWillBeMintedAfterPurchase > totalTokensForSaleDuringPreICO)) {
        msg.sender.transfer(msg.value); // Refund them
        EthRefunded("PreICO Limit Hit");
        return;
      }
```

It is better to user `revert` here?
