Add resistantBalanceAndFei to Curve deposit#169
Merged
Joeysantoro merged 5 commits intofei-protocol:feat/v2from Sep 13, 2021
Merged
Add resistantBalanceAndFei to Curve deposit#169Joeysantoro merged 5 commits intofei-protocol:feat/v2from
Joeysantoro merged 5 commits intofei-protocol:feat/v2from
Conversation
Joeysantoro
reviewed
Sep 12, 2021
Joeysantoro
reviewed
Sep 13, 2021
Joeysantoro
reviewed
Sep 13, 2021
Joeysantoro
reviewed
Sep 13, 2021
|
|
||
| /// @notice set the minimum ratio threshold for a valid reading of restistant balances | ||
| function setMinRatio(uint256 _minimumRatioThreshold) public onlyGovernor { | ||
| require(_minimumRatioThreshold < maximumRatioThreshold, "Min ratio must be less than max ratio"); |
Contributor
There was a problem hiding this comment.
A good pattern for this is to have an internal method that gets called by both the governor setter and constructor
Joeysantoro
reviewed
Sep 13, 2021
Joeysantoro
reviewed
Sep 13, 2021
| require(minimumRatioThreshold < maximumRatioThreshold, "Min ratio must be less than max ratio"); | ||
| require(minimumRatioThreshold >= 0.01e18, "Min ratio must be at least 1%."); | ||
| require(maximumRatioThreshold <= 100e18, "Max ratio cannot be above 100x."); | ||
| setMinRatio(_minimumRatioThreshold); |
Contributor
There was a problem hiding this comment.
Should call the internal ones, caller is unlikely to be a gov
Joeysantoro
reviewed
Sep 13, 2021
| require(_maximumRatioThreshold > minimumRatioThreshold, "Max ratio must be greater than min ratio"); | ||
| require(_maximumRatioThreshold <= 100e18, "Max ratio cannot be above 100x."); | ||
|
|
||
| maximumRatioThreshold = _maximumRatioThreshold; |
Contributor
There was a problem hiding this comment.
Should call internal method here
Joeysantoro
reviewed
Sep 13, 2021
| require(_minimumRatioThreshold < maximumRatioThreshold, "Min ratio must be less than max ratio"); | ||
| require(_minimumRatioThreshold >= 0.01e18, "Min ratio must be at least 1%."); | ||
|
|
||
| minimumRatioThreshold = _minimumRatioThreshold; |
Contributor
There was a problem hiding this comment.
Should call internal method here
Joeysantoro
reviewed
Sep 13, 2021
Joeysantoro
reviewed
Sep 13, 2021
| _setMaxRatioThreshold(_maximumRatioThreshold); | ||
| } | ||
|
|
||
| function _setMinRatioThreshold(uint256 _minimumRatioThreshold) private { |
Contributor
There was a problem hiding this comment.
I like to keep these methods internal vs private in case we ever write a superclass that needs to overwrite these vars
Joeysantoro
approved these changes
Sep 13, 2021
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.