From 9b2d9940fb50b12acab5961b851633c7335d69ab Mon Sep 17 00:00:00 2001 From: heswithme Date: Thu, 17 Oct 2024 16:58:39 +0200 Subject: [PATCH] fix: get rid of balanceOf --- contracts/RewardsHandler.vy | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/contracts/RewardsHandler.vy b/contracts/RewardsHandler.vy index b978bfa..c283336 100644 --- a/contracts/RewardsHandler.vy +++ b/contracts/RewardsHandler.vy @@ -201,10 +201,9 @@ def _take_snapshot(): # supply in circulation = controllers' debt + peg keppers' debt circulating_supply: uint256 = staticcall self.stablecoin_lens.circulating_supply() - # obtain the supply of crvUSD contained in the vault by simply checking its - # balance since it's an ERC4626 vault. This will also take into account - # rewards that are not yet distributed. - supply_in_vault: uint256 = staticcall stablecoin.balanceOf(vault.address) + # obtain the supply of crvUSD contained in the vault by checking its + # totalAssets. This will also not take into account rewards that are not yet distributed. + supply_in_vault: uint256 = staticcall vault.totalAssets() # here we intentionally reduce the precision of the ratio because the # dynamic weight interface expects a percentage in BPS.