-
Notifications
You must be signed in to change notification settings - Fork 1
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
add piTokenCallback to PowerIndexRouter.sol #12
Conversation
Codecov Report
@@ Coverage Diff @@
## master #12 +/- ##
==========================================
- Coverage 84.18% 83.82% -0.37%
==========================================
Files 11 11
Lines 569 581 +12
Branches 95 99 +4
==========================================
+ Hits 479 487 +8
- Misses 90 94 +4
Continue to review full report at Codecov.
|
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.
Please check the comment, it describes a potential minor issue.
Besides, PowerIndexRouter
contract includes HUNDRED_PCT = 1 ether
constant. However, the code includes 1 ether
and 0.1 ether
multipliers. Consider replacing them with HUNDRED_PCT
-based values.
contracts/PowerIndexRouter.sol
Outdated
@@ -766,6 +794,7 @@ contract PowerIndexRouter is PowerIndexRouterInterface, PowerIndexNaiveRouter { | |||
{ | |||
require(_reserveRatioPct <= HUNDRED_PCT, "RR_GREATER_THAN_100_PCT"); | |||
expectedStakeAmount = getExpectedStakeAmount(_reserveRatioPct, _leftOnPiToken, _totalStakedBalance, _share); | |||
expectedStakeAmount = expectedStakeAmount.add(_addToExpectedStakeAmount.mul(_share).div(1 ether)); |
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.
It seems that _addToExpectedStakeAmount
value is processed incorrectly, as this line doesn't account for reserve %.
In this case consider adding _addToExpectedStakeAmount
value to either _leftOnPiToken
of _totalStakedBalance
at the line above.
ac00a61
to
283320c
Compare
No description provided.