I developed ICO on solidity. As everyone knows smart contracts only accept ETH, but I've seen many ICOs which accept BTC and any other cryptocurrency as well. I want to know how can I handle it if someone sends BTC in ICO contract to get ERC20 tokens in return. Please answer, I am stuck on this.
As everyone knows smart contracts only accept ETH.
They can manage ETH and tokens.
How can I transfer ERC20 Tokens to Bitcoin donor in ICO?
You could use Wrapped BTC (wBTC) which is an ERC20 token backed by Bitcoin, such that its price follows that of BTC (https://etherscan.io/token/0x2260fac5e5542a773aa44fbcfedf7c193bc2c599). Therefore, instead of sending BTC to the ICO smart contract, investors will send wBTC. As it is an ERC20, you can handle it easily in your contract.