Skip to content

Commit

Permalink
Add comment
Browse files Browse the repository at this point in the history
  • Loading branch information
shahthepro committed Sep 27, 2024
1 parent 852ef4e commit 1d24177
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions contracts/contracts/harvest/FixedRateDripper.sol
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,13 @@ contract FixedRateDripper is Dripper {
function setDripRate(uint192 _perSecond) external onlyGovernorOrStrategist {
emit DripRateUpdated(_perSecond, drip.perSecond);

/**
* Note: It's important to call `_collect` before updating
* the drip rate especially on a new proxy contract.
* When `lastCollect` is not set/initialized, the elapsed
* time would be calculated as `block.number` seconds,
* resulting in a huge yield, if `collect` isn't called first.
*/
// Collect at existing rate
_collect();

Expand Down

0 comments on commit 1d24177

Please sign in to comment.