-
Notifications
You must be signed in to change notification settings - Fork 3
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
chore(sol): default decimal adjustment to 1 #57
Conversation
Currently the pool contract is converting the underlying decimals to the pool token decimals before calling the fee calculator so there is no need to adjust the amount in the fee calculator, hence default feeToUnderlyingDecimalsScale to 1.
We should also consider reverting #55 and treat amounts sent to the fee calculator as pool amounts. Anyway users shouldn't need to interact directly with the fee calculator, instead the pool contract offers a holistic interface that handles conversions. |
If we revert #55 at the very least we should document that callers should be converting the provided amounts to the pool token's precision in NatSpec.
A few arguments against reverting:
|
can you please add "distributed" to this line while you're at it? it's hurting my eyes :)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how are no tests affected by this change?
Feel free to open a PR for it please as it's not related to my changes. |
I think this is because the fuzzing test suite was already setting the underlying decimals to 1 here. |
@0xmichalis i in principle also don't have a strong opinion, but defaulting to 1 seems to be a half baked solution between delegating the conversion to the Pool vs having the calculator taking this responsibility. My preferred way to go (assuming it's THE WAY) would be to either remove the knowledge of the underlying decimals completely from the calculator, or leave it all there. But like it is here, it's a half step, which if left untouched will leave even more confusion around. Do you think we can just roll back #55 at this point? |
Not sure what you mean exactly by "leave it all there"? Presumably you mean that the pool should stop sending converted amounts to the fee calculator and the fee calculator should be configured to work with the underlying decimals? Agreed that as it stands it's half-baked, it's likely fine to revert #55 at the expense of making the calculator less reusable for ERC-1155 use cases. |
Closing in favor of #58 |
that's what I meant.
true, but we can still roll out a new calculator in the future if we see the need/demand, and make it more flexible in case... |
Currently the pool contract is converting the underlying decimals to the pool token decimals before calling the fee calculator so there is no need to adjust the amount in the fee calculator, hence default feeToUnderlyingDecimalsScale to 1.