From 063c9237d696683f37444054a91e99ec3805b50a Mon Sep 17 00:00:00 2001 From: Mick de Graaf Date: Tue, 8 Dec 2020 13:50:10 +0100 Subject: [PATCH] Charge annualized fee when changing fee params --- contracts/facets/Basket/BasketFacet.sol | 2 ++ 1 file changed, 2 insertions(+) diff --git a/contracts/facets/Basket/BasketFacet.sol b/contracts/facets/Basket/BasketFacet.sol index 16fb8ae..2dc6fbe 100644 --- a/contracts/facets/Basket/BasketFacet.sol +++ b/contracts/facets/Basket/BasketFacet.sol @@ -74,6 +74,7 @@ contract BasketFacet is ReentryProtection, CallProtection, IBasketFacet { } function setAnnualizedFee(uint256 _fee) external override protectedCall { + chargeOutstandingAnnualizedFee(); require(_fee <= MAX_ANNUAL_FEE, "FEE_TOO_BIG"); LibBasketStorage.basketStorage().annualizedFee = _fee; emit AnnualizedFeeSet(_fee); @@ -84,6 +85,7 @@ contract BasketFacet is ReentryProtection, CallProtection, IBasketFacet { } function setFeeBeneficiary(address _beneficiary) external override protectedCall { + chargeOutstandingAnnualizedFee(); LibBasketStorage.basketStorage().feeBeneficiary = _beneficiary; emit FeeBeneficiarySet(_beneficiary); }