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

GaugeController: Add Events & Natspec #276

Merged
merged 15 commits into from
Jun 1, 2022
Merged
65 changes: 61 additions & 4 deletions contracts/GaugeController.sol
Original file line number Diff line number Diff line change
Expand Up @@ -65,17 +65,74 @@ contract GaugeController is IGaugeController, Ownable {
/// @notice Governance scale set for existing Gauge.
mapping(address => TwabLib.Account) internal gaugeScaleTwabs;

/**
* @notice Event emitted when the contract is deployed
* @param token Address of the token being staked in the gauge
*/
event Deployed(IERC20 token, IGaugeReward gaugeReward, address owner);
kamescg marked this conversation as resolved.
Show resolved Hide resolved

/**
* @notice Emitted when GaugeReward address is set/updated
* @param gaugeReward Address of the newly set GaugeReward contract
*/
*/
event GaugeRewardSet(IGaugeReward gaugeReward);

/**
* @notice Event emitted when the contract is deployed
* @param token Address of the token being staked in the gauge
* @notice Emitted when User deposits 'token' into the gauge.
* @param user Address of the user who deposited 'token' into the GaugeController
kamescg marked this conversation as resolved.
Show resolved Hide resolved
* @param amount Amount of 'token' deposited into the GaugeController
*/
event Deployed(IERC20 token, IGaugeReward gaugeReward, address owner);
event UserDeposit(address user, uint256 amount);
kamescg marked this conversation as resolved.
Show resolved Hide resolved

/**
* @notice Emitted when User withdraws 'token' from the gauge.
* @param user Address of the user who withdrew 'token' from the GaugeController
kamescg marked this conversation as resolved.
Show resolved Hide resolved
* @param amount Amount of 'token' withdrawn from the GaugeController
*/
event UserWithdraw(address user, uint256 amount);
kamescg marked this conversation as resolved.
Show resolved Hide resolved

/**
* @notice Emitted when User increases a Gauge weight.
* @param user User address
* @param gauge Existing Gauge address
* @param amount Amount of 'balance' debited from the User and credited to the Gauge
*/
event UserGaugeIncrease(address user, address gauge, uint256 amount);
kamescg marked this conversation as resolved.
Show resolved Hide resolved

/**
* @notice Emitted when User decrease a Gauge weight.
* @param user User address
* @param gauge Existing Gauge address
* @param amount Amount of 'balance' debited from the Gauge and credited to the User
*/
event UserGaugeDecrease(address user, address gauge, uint256 amount);
kamescg marked this conversation as resolved.
Show resolved Hide resolved

/**
* @notice Emitted when an Authorized User adds a new Gauge to the GaugeController
* @param gauge New Gauge address
*/
event AuthorityAddGauge(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.

We should also pass the scale:

Suggested change
event AuthorityAddGauge(address gauge);
event GaugeAdded(address indexed user, address indexed gauge, uint256 scale);

Copy link
Contributor

Choose a reason for hiding this comment

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

Need to be renamed GaugeAdded.


/**
* @notice Emitted when an Authorized User removes an existing Gauge from the GaugeController
* @param gauge New Gauge address
kamescg marked this conversation as resolved.
Show resolved Hide resolved
*/
event AuthorityRemoveGauge(address gauge);
kamescg marked this conversation as resolved.
Show resolved Hide resolved

/**
* @notice Emitted when an Authorized User sets an existing Gauge 'scale' weight.
* @param gauge New Gauge address
kamescg marked this conversation as resolved.
Show resolved Hide resolved
* @param scale New Gauge scale
* @param oldScale Old Gauge scale
*/
event AuthoritySetGaugeScale(address gauge, uint256 scale, uint256 oldScale);
kamescg marked this conversation as resolved.
Show resolved Hide resolved

/**
* @notice Emitted when an Authorized User sets an existing Gauge 'reward' weight.
* @param gaugeReward New GaugeReward address
* @param oldGaugeReward Old GaugeReward address
*/
event AuthoritySetGaugeReward(address gaugeReward, address oldGaugeReward);
kamescg marked this conversation as resolved.
Show resolved Hide resolved

/* ================================================================================ */
/* Constructor & Modifiers */
Expand Down