Skip to content
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

Merged
merged 16 commits into from
May 31, 2022

Conversation

kamescg
Copy link
Contributor

@kamescg kamescg commented May 25, 2022

No description provided.

@kamescg kamescg requested a review from PierrickGT May 25, 2022 14:43
@kamescg kamescg self-assigned this May 25, 2022
@linear
Copy link

linear bot commented May 25, 2022


/**
* @notice Tracks user rewards for staking.
* @dev The rewards is updated in
Copy link
Contributor

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.

Copy link
Contributor Author

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

contracts/GaugeController.sol Outdated Show resolved Hide resolved
@@ -33,16 +79,43 @@ contract GaugeController is IGaugeController {
rewardVault = _rewardVault;
}

modifier requireGauge(address _gauge) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add Natspec doc.

@@ -33,16 +79,43 @@ contract GaugeController is IGaugeController {
rewardVault = _rewardVault;
Copy link
Contributor

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.

Copy link
Contributor Author

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");
Copy link
Contributor

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.

Copy link
Contributor Author

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.

contracts/GaugeController.sol Outdated Show resolved Hide resolved
contracts/GaugeController.sol Outdated Show resolved Hide resolved
contracts/GaugeController.sol Outdated Show resolved Hide resolved
contracts/GaugeController.sol Outdated Show resolved Hide resolved
contracts/GaugeController.sol Outdated Show resolved Hide resolved
@kamescg kamescg requested a review from asselstine May 25, 2022 16:26
IGaugeReward _gaugeReward,
address _owner
) Ownable(_owner){
require(address(_token) != address(0), "GC/token-not-zero-address");
Copy link
Contributor

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.

contracts/GaugeController.sol Show resolved Hide resolved
contracts/GaugeController.sol Show resolved Hide resolved
*/
interface IGaugeReward {
/**
* @notice Fallback function to call in GaugeController after a user has increased their gauge stake.
Copy link
Contributor

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.

contracts/interfaces/IGaugeReward.sol Outdated Show resolved Hide resolved
@kamescg kamescg merged commit 5f82459 into staging May 31, 2022
@kamescg kamescg deleted the pool-2279-add-natspec-to-gaugecontroller branch May 31, 2022 22:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants