Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New/transfer dividends #287

Merged
merged 5 commits into from
Apr 13, 2020
Merged

New/transfer dividends #287

merged 5 commits into from
Apr 13, 2020

Conversation

alcueca
Copy link
Contributor

@alcueca alcueca commented Mar 31, 2020

Now that we can use openzeppelin-contracts 3.0, we can use the _beforeTokenTransfer hook in ERC20.sol to adjust dividends for mint and transfer.

The idea is that dividends are "attached" to their tokens. If a token owner transfers tokens with unclaimed dividends, the dividends now can be claimed by the recipient.

When tokens are minted, the recipient won't get any additional dividends from them, until the next dividend release.

When tokens are burned, any unclaimed dividends remain in the contract.

@alcueca alcueca requested review from uivlis and vibern0 March 31, 2020 20:38
@alcueca
Copy link
Contributor Author

alcueca commented Mar 31, 2020

@uivlis, I thought you would like to see this issue closed.

Copy link
Member

@vibern0 vibern0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm approving, cuz this is good, but please give feedback to my comment.

contracts/utils/SafeCast.sol Show resolved Hide resolved
@alcueca alcueca merged commit d58c37c into master Apr 13, 2020
@alcueca alcueca deleted the new/transfer-dividends branch April 13, 2020 08:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants