title: How to receive ETH in a smart contract
body: <p>i am working on an ico and i got this code, the crowdsale was with dai token but i want to work with ether,
  how can i do that ?</p>
  <pre><code>IERC20 public dai = IERC20(0x6B175474E89094C44Da98b954EedeAC495271d0F);
  function buy(uint etherAmount)
      external
      icoActive() {
      require(
        etherAmount &gt;= minPurchase &amp;&amp; etherAmount &lt;= maxPurchase, 
        'have to buy between minPurchase and maxPurchase'
      );
      uint tokenAmount = etherAmount.div(price);
      
      require(
        tokenAmount &lt;= availableTokens, 
        'Not enough tokens left for sale'
      );
      dai.transferFrom(msg.sender, address(this), etherAmount);
      token.mint(address(this), tokenAmount);
      sales[msg.sender] = Sale(
          msg.sender,
          tokenAmount,
          false
      );
  }
  </code></pre>