0

I want to implement an investment service based on ethereum smart contracts in which customers receive dividends four times in a month. For example, a customer receives dividends on 8th, 16th, 21th, and 26th of a month in a recurrent manner.

Is it possible to implement without any third-party services, e.g., AION or Ethereum Alarm Clock?

I was wondering if you help me with this case.

1 Answer 1

1

Smart contracts can't trigger themselves. Their functionality is always triggered by an EOA (Externally Owned Account). In this way the EOA also pays for the execution cost (gas).

So you can't make the contract push the payments in this way.

However, what you could do is make it a pull-based system. So you can add a withdrawal function which gives out dividends when someone calls it who has the proper access and it's the right timing. This is also much safer: pull schemas are considered much safer security-wise than push schemas. The only downside is that the investors need to initiate the transactions themselves, but you can just enable the contract to pay out all the dividends at once which haven't been paid out to the caller - for example if an investor calls the contract only once a year the contract can pay all the due dividends at once.

2
  • Thank you very much. How about a server-centric approach? I mean, calling the withdrawal function concurrently from server.
    – Nima shiri
    Commented Sep 6, 2020 at 13:34
  • It doesn't matter if it's a human being or a server issuing the transaction - just any EOA. But the problem remains pretty much the same - some entity has to initiate it. Commented Sep 6, 2020 at 13:37

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