1

Is it possible to do a reverse crowd sale? e.g. send tokens to a smart contract to get ether back. Or would this require to load the contract with WETH or something in advance?

1

If I understand correctly you already have a token and a regular smart contract which has been used for token distribution and you now want to write a new contract for reverse distribution.

A small problem is that a contract can't detect when someone sends it tokens (and anyway contracts can't execute anything by themselves - only through a transaction). But what you can do it write a contract which handles the token transfer by itself - the token owner just needs to approve token withdrawal in advance. So it could work something like this:

1) Token owner issues a approve transaction to the token contract and names your reverse contract as the spender.

2) Token owner issues a separate transaction to your reverse contract which performs the transfer with transferFrom

3) If the token transfer (transferFrom) is successful the contract sends Ether to the (ex) token owner.

  • I'm trying to understand if you can create a crowd sale where the payment method is ERC20 tokens, and the distributed currency is Ether. – NowsyMe Apr 14 at 17:58
  • As I see it, yes, as I just tried to describe in my answer. If you didn't understand some part of the answer feel free to ask more about it. – Lauri Peltonen Apr 15 at 6:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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