From 1d24177f6a6f8d222f50d74692cec520672de13c Mon Sep 17 00:00:00 2001 From: Shahul Hameed <10547529+shahthepro@users.noreply.github.com> Date: Fri, 27 Sep 2024 07:52:47 +0400 Subject: [PATCH] Add comment --- contracts/contracts/harvest/FixedRateDripper.sol | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/contracts/contracts/harvest/FixedRateDripper.sol b/contracts/contracts/harvest/FixedRateDripper.sol index 06636e9c29..2d96a065b2 100644 --- a/contracts/contracts/harvest/FixedRateDripper.sol +++ b/contracts/contracts/harvest/FixedRateDripper.sol @@ -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();