eos icon indicating copy to clipboard operation
eos copied to clipboard

ICO - can I block EOS transfer before certain date?

Open filipniziol opened this issue 8 years ago • 4 comments

Is it possible the following: A person send EOS to a contract account before certain date, and the tokens are rejected? Or I have to watch all the transactions and if they do not meet the criteria, I have to return the tokens as a second transaction paying for cpu and bandwidth?

filipniziol avatar Jun 23 '18 19:06 filipniziol

You can write a contract which rejects incoming transfers based on rules you provide. e.g. https://gist.github.com/tbfleming/d230f3ab2998e8858d3e51af7e4d9aeb

tbfleming avatar Jun 23 '18 20:06 tbfleming

Looks good! So you can take eosio.token transfer action to the contract and rewrite it, if it is the receiver of the method?

filipniziol avatar Jun 24 '18 04:06 filipniziol

Yes

tbfleming avatar Jun 24 '18 20:06 tbfleming

So you can take eosio.token transfer action to the contract and rewrite it, if it is the receiver of the method?

Just to be clear, the way this works is the eosio.token contract will call require_recipient with the account the tokens are going to. This means that the transfer action will be re-delivered to any contract installed on that account. However, this does not allow you to "rewrite" the action processing in eosio.token that would be a security hole. It does allow you to reject a transaction by throwing an error since that would fail the whole transaction and safely roll back any side effects in the other actions.

wanderingbort avatar Jun 25 '18 12:06 wanderingbort