2

Is it possible to issue a token and then send certain amount of ethereum to coin owners. For example is Alice owns 4 my token and Bob owns 6 of my tokens I want to send in total 10 Ethereums to my token owners, in this example Alice will receive 4 Ethereums and Bob 6 and I want to repeat this action every month. Can someone tell me if it is possible to make this kind of contract? If it is possible I think there should be some global function, but unfortunately I couldn't find.

1

A contract cannot start a transaction of its own. You will need someone to start the transaction every month. But otherwise everything else should be possible.

  • 1
    Sure I can manage transaction every month manually but for example if Bob bought 5 tokens and then he resold it to Sally is it possible to send Ethereum to Sally and not to Bob? – Kiknaio Jun 3 '17 at 22:46
  • @George That should be possible, you need to track amount of tokens for each user. – Ismael Jun 3 '17 at 22:53
  • Can you please write the code which will give me all the wallets who currently owns my token? – Kiknaio Jun 5 '17 at 11:36
  • You need at least two mappings mapping (address => uint) balances; mapping (uint => address) addresses; uint index;. When you add a new address you do something like this addresses[index++] = msg.sender; balances[msg.sender] = balance;. Then to know the addresses that have balance you use the addresses mapping. Be careful if your mapping have too many addresses it will use lot of gas. – Ismael Jun 5 '17 at 15:18
  • 1
    Sorry, but you should ask a new question, I'm do not know enough about swarm to reply. – Ismael Jun 5 '17 at 19:00
1

You can schedule execution in future with external tools such as

You will schedule for a specific block in future witch is quite accurate if you operate in terms of months at a specific day

  • Sounds interesting. Appreciate your answer – Kiknaio Jun 3 '17 at 23:14
0

You can use Ethereum Alarm Clock. To schedule transaction you can use:

  1. MyCrypto wallet
  2. Chronos DAPP
  3. programmatical library @ethereum-alarm-clock/lib

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.