-
Notifications
You must be signed in to change notification settings - Fork 80
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
L-03 Abstraction of Pool Exit Kinds Is Error-Prone #1916
L-03 Abstraction of Pool Exit Kinds Is Error-Prone #1916
Conversation
Codecov Report
@@ Coverage Diff @@
## sparrowDom/L-04-exit-kind-enum #1916 +/- ##
=================================================================
Coverage ? 57.28%
=================================================================
Files ? 51
Lines ? 2730
Branches ? 703
=================================================================
Hits ? 1564
Misses ? 1163
Partials ? 3 📣 Codecov offers a browser extension for seamless coverage viewing on GitHub. Try it in Chrome or Firefox today! |
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.
Way better.
Can merge, will verify when integrated.
ed8a545
into
sparrowDom/L-04-exit-kind-enum
* rename enum variables * L-03 Abstraction of Pool Exit Kinds Is Error-Prone (#1916) * turn config vars into functions * clean up deployment files * clean up comments * prettier * prettier
Audit notes:
The use of different enum indices, namely
balancerBptInExactTokensOutIndex
andbalancerExactBptInTokensOutIndex
, to be passed to Balancer for different pool typesis achieved by passing constructor input arguments and storing immutable variables.
However, this approach is error-prone. It reduces readability and makes it difficult for off-chain
tooling and governance to correctly test and pass the arguments during deployment, and verify
the result. As such, any mistake in setting these values could have severe consequences.
Consider creating and overriding internal functions in each class. This will not increase the gas
usage but will ensure that the correct value is always used for each concrete contract. A
simplified example is shown below: