Hey Nick,
Yep — I saw your article — it was the first one I read on the topic ;-).
The reason I didn’t link to it (I probably should have) is that, based on my understanding of your pseudo code, your approach had the following features:
- It pays out dividends in tokens rather than an independent medium of value (e.g. Ether). accounts[account].balance is used both to calculate the proportion of dividend due (as a percentage of total supply) and also incremented by the amount due.
- In the updateAccount modifier, I assumed (possibly incorrectly) that the input account would be the account that tokens were being transferred from. In this case it seems like the account to which tokens are transferred would then be able to claim an additional dividend based on its new balance (since for the new account, lastDividends would be initialised to 0).
Above could well be based on a misunderstanding of the pseudo code, but I couldn’t find a non-pseudo code full implementation (which I’d be interested in seeing if you have one!) to delve into further.
One other point is that your approach requires the ERC20 token to have the relevant modifiers upfront, which would be hard for a company that has already issued a MiniMeToken style token.
Thanks for your feedback — I see your name all over the place and am always very impressed by your technical chops!
Thanks,
Adam
