-
Notifications
You must be signed in to change notification settings - Fork 49
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
Update(GaugeController.sol): Add NatSpec and Comments #273
Conversation
|
||
/** | ||
* @notice Tracks user rewards for staking. | ||
* @dev The rewards is updated in |
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.
Add functions in which the rewards are updated.
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.
There are no functions at the moment which update rewards
@@ -33,16 +79,43 @@ contract GaugeController is IGaugeController { | |||
rewardVault = _rewardVault; | |||
} | |||
|
|||
modifier requireGauge(address _gauge) { |
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.
Add Natspec doc.
contracts/GaugeController.sol
Outdated
@@ -33,16 +79,43 @@ contract GaugeController is IGaugeController { | |||
rewardVault = _rewardVault; |
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.
Add requires to check for address zero.
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.
Agree. Out of scope for natspec PR though.
@@ -33,16 +79,43 @@ contract GaugeController is IGaugeController { | |||
rewardVault = _rewardVault; | |||
} | |||
|
|||
modifier requireGauge(address _gauge) { | |||
require(isGauge(_gauge), "GaugeController:invalid-address"); |
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.
We should also create an internal function _isGauge
to call in this modifier to avoid calling a public function.
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.
Agree. Out of scope for natspec PR though.
Co-authored-by: Pierrick Turelier <pierrick@turelier.com>
Co-authored-by: Pierrick Turelier <pierrick@turelier.com>
Co-authored-by: Pierrick Turelier <pierrick@turelier.com>
Co-authored-by: Pierrick Turelier <pierrick@turelier.com>
IGaugeReward _gaugeReward, | ||
address _owner | ||
) Ownable(_owner){ | ||
require(address(_token) != address(0), "GC/token-not-zero-address"); |
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.
Add the same kind of require for _gaugeReward
.
*/ | ||
interface IGaugeReward { | ||
/** | ||
* @notice Fallback function to call in GaugeController after a user has increased their gauge stake. |
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.
I described it as being a callback function and not a fallback function since it's being called after increasing the gauge and not in replacement of the function to increase gauge but it's not a callback function either, so we could just say:
Called in GaugeController after a user has increased their gauge stake.
No description provided.