Search code examples
blockchainethereumsolidityerc20

Is it possible to send erc20 tokens into a smart contract on ethereum and send back ether or another token?


I currently working on an ICO, although our platform in the future will require a token holder to send in their token to receive rewards.

I'm trying to develop a method to exchange the token for other tokens we create or ether and burn the tokens. Does anyone know if its possible and if any one has any ideas how to approach it?


Solution

  • Yes you can do that. So basically there are 2 things in your question-:

    1. Burnable tokens
    2. Something like crowdsales where investors should be able to buy your tokens using ether or other tokens supported by your contract. Both of the approaches are possible and you can see a sample code in open-zeppelin's github repository.