-
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
feat: allow for different decimals between fee token and underlying #55
feat: allow for different decimals between fee token and underlying #55
Conversation
@kosecki123 what's the plan with this FlatFeeCalculator? Are we gonna use it only for the REDD pool? alternatively we can keep it like this and redeploy a more general version later in case we have the need. |
Depends on how you want to treat the fee calculators, as a shared deployed contract or per pool deployment. Either way we need to have the scaler. I like the idea of passing the scale with the fee calculation, make the calculator generic. |
Thinking about it, this issue can only happen with ERC20 tokens. ERC1155 tokens all have the same decimals, which is 0 (as they are non fungible and not fractionary) |
We don't need this feature after all since currently the pool contract takes care of the conversion. I have opened #57 to default |
@sirnicolaz I don't follow this comment. ERC1155 is fully capable of supporting fungible fractional amounts. The standard even mentions |
Revert ToucanProtocol#55 since the underlying decimals conversion does not need to happen at the calculator and it's currently handled by the pool.
This PR adds extra variable called
feeToUnderlyingDecimalsScale
with default1e0
to accommodate the difference in decimals amount for fee token and underlying token (deposit / redeem amount).
setFeeToUnderlyingDecimalsScale
added for owner to allow setting the scale.