-
Notifications
You must be signed in to change notification settings - Fork 107
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
WIP: Fix transfer dividendability #218
Conversation
The A test failing by a factor of 10 will be either an issue with my calculations, or one of the test constants off by a factor of 10. I've got a few things today, but I'll have a look later on. Thanks a lot for your effort with this. |
Ok, I had a look. It all probably down to not knowing exactly what is a fixed point number and what isn't. The verbosity of Fixidity doesn't help. When you get a function with wei quantities like A token that implements ERC20Detailed has it's own fixed point math system fueled by When you call Let's leave this branch here. We need to fix a few things in the previous PR. It worked quite by accident 😮 |
See if after merging #224 we can work on this one again. When using |
Thanks, @albertocuestacanada,
And also,
|
I had a look at the code, and this will be cleaner to fix once we migrate to solidity 0.6 and the ERC20 hooks that openzeppelin has implemented become available. The |
Fixes #215.
Alright, I've been banging my head with this and still can't figure it out.
The first test fails by an order of just 10.
The second reverts.
Also, had to add an
.abs()
somewhere in the differential because there was a subtraction overflow, not sure if the formula thus preserves its validity.Begging for help...
But still, I am not convinced we need this. Dividends are disbursed to holders based on the balances at the time of dividend incoming, not at the time of claiming, aren't they (in which case the transfer bug is a bug no more)? If I have 50% of a company, and I disburse dividends annually, say I make in February 100$, and in December I quit from the board. At the end of the year, shouldn't I get those 50$ that is rightfully mine? If we solve this bug, the answer would be a staggering no.