-
Notifications
You must be signed in to change notification settings - Fork 11
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
fix: validate token precision multiplier #241
fix: validate token precision multiplier #241
Conversation
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.
LGTM if we want to go down this route 👍
I personally would argue there is no need for the setTokenPrecisionMultipliers function in the beginning.
They are automatically set in the createExchange function by calling decimals() on the token contract. The only context where these multipliers are used is in quotes/swaps and those only work on a valid exchanges. So what is the use case for this function in my opinion it can only cause problems by setting wrong values, but maybe I am missing something 😁
I agree with you. I don't feel strongly about keeping this function, it does not add much. However, there is no harm in having it there 🤷♂️. The only use case that comes to mind is if the multiplier was set incorrectly when creating an exchange, this would allow that to be corrected without recreating the exchange. |
Agree with @philipraetsch here that this function seems a bit pointless.
The value added doesn't seem worth it to me. In the spirit of having less code, I would say let's remove it Update: chatted with the big boss offline and he said: "kill it with fire" 🔥 |
66f8ccc
to
22febd7
Compare
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.
🔥
Description
This change adds validation to the function
BiPoolManager.setTokenPrecisionMultipliers
similar to that in the create pool function. The change verifies the tokens being added to the mapping are known by the reserve and the precisions are within the allowed range.Other changes
Tested
Related issues
Backwards compatibility
Documentation