releaseDividends() :
This function is used to release dividends to the shareholders of a company. It works by taking the amount of money sent to the contract (msg.value) and passing it to the _releaseDividends() function, which is responsible for distributing the dividends to the shareholders. (autogenerated documentation)
claimDividends() :
This function allows a user to claim any dividends that have been accrued to their account. It works by calling the _claimDividends() function, passing in the address of the user who is claiming the dividends as an argument. The function then returns the amount of dividends that have been claimed. (autogenerated documentation)
_releaseDividends(uint256) :
This function releases dividends to all token holders. It takes in an amount of Ether as an argument and divides it by the total supply of tokens. The resulting amount is then added to the dividendsPerToken variable, which is a mapping of addresses to the amount of dividends they have. The address of 0 is then set to the total amount of dividends per token. This allows all token holders to access the amount of dividends they have. (autogenerated documentation)
_claimDividends(address) :
This function allows a user to claim any dividends that are owed to them. It takes an address payable account as an argument and returns the amount of dividends that are owed to the account. It first checks to make sure that the account has dividends owing, and then transfers the amount to the account. It then updates the claimedDPT mapping with the amount of dividends per token. (autogenerated documentation)
_dividendsOwing(address) :
This function calculates the amount of dividends that are owed to a given account. It does this by subtracting the amount of dividends that have already been claimed by the account from the total amount of dividends per token, and then multiplying this difference by the account's token balance. The result is returned as a uint256. (autogenerated documentation)
_beforeTokenTransfer(address,address,uint256) :
This function is used to transfer tokens between two addresses. It works by calculating the weight of the transfer, which is the amount of tokens being transferred divided by the total balance of the receiving address. It then calculates the differential DPT, which is the difference between the DPT of the sending address and the DPT of the receiving address. Finally, it calculates the weighted DPT, which is the differential DPT multiplied by the weight of the transfer. The weighted DPT is then added to the DPT of the receiving address. (autogenerated documentation)