Dividend ERC20 Token
An ERC20 token that allows the distribution of another, or the same, ERC20 token in the form of dividends.
Dividend Distribution
Each time dividends are distributed, the total dividends variable is updated. It is increased by:
Claiming Dividends
Each time a user claims dividends their last claim is updated. The last claim is the value of the total dividends since their last claim. The amount they can claim is the difference between the total dividends and the last claim multiplied by the amount of tokens that they hold:
Each time a user makes a transfer both the recipient and the sender claim their dividends. This is to prevent duplicate claims.
Distributing the Excess Balance
The dividend ERC20 contract should never be able to claim dividends; Instead, the contract's excess dividend token balance should be distributed among everyone else. In order to account for this discrepency the total dividends calculation is modified as so:
The excess balance in the contract is calculated in the following way and then distributed:
Last updated