From 3e1154bc947aa623673821cb8fc4b1420876a219 Mon Sep 17 00:00:00 2001 From: Jonny Rhea <5555162+jrhea@users.noreply.github.com> Date: Tue, 14 Nov 2023 13:01:19 -0600 Subject: [PATCH] ensure the event emits amount in units of base (#671) --- contracts/src/internal/HyperdriveAdmin.sol | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/contracts/src/internal/HyperdriveAdmin.sol b/contracts/src/internal/HyperdriveAdmin.sol index 7642a19c5..480acae82 100644 --- a/contracts/src/internal/HyperdriveAdmin.sol +++ b/contracts/src/internal/HyperdriveAdmin.sol @@ -20,7 +20,7 @@ abstract contract HyperdriveAdmin is HyperdriveBase { /// @dev This function collects the governance fees accrued by the pool. /// @param _options The options that configure how the fees are settled. - /// @return proceeds The amount of base collected. + /// @return proceeds The amount collected in units specified by _options. function _collectGovernanceFee( IHyperdrive.Options calldata _options ) internal nonReentrant returns (uint256 proceeds) { @@ -42,7 +42,10 @@ abstract contract HyperdriveAdmin is HyperdriveBase { uint256 governanceFeesAccrued = _governanceFeesAccrued; delete _governanceFeesAccrued; proceeds = _withdraw(governanceFeesAccrued, _options); - emit CollectGovernanceFee(_feeCollector, proceeds); + emit CollectGovernanceFee( + _feeCollector, + _convertToBaseFromOption(proceeds, _pricePerShare(), _options) + ); } /// @dev Allows an authorized address to pause this contract.