From 632221161e98f3020f4c313aacbe6cc3a25528eb Mon Sep 17 00:00:00 2001 From: ungaro Date: Mon, 9 Dec 2024 10:19:21 -0500 Subject: [PATCH 1/2] change balanceof and assetsOf functions - WIP --- nest/src/token/BoringVaultAdapter.sol | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/nest/src/token/BoringVaultAdapter.sol b/nest/src/token/BoringVaultAdapter.sol index 2407ad4..34399c5 100644 --- a/nest/src/token/BoringVaultAdapter.sol +++ b/nest/src/token/BoringVaultAdapter.sol @@ -448,8 +448,7 @@ abstract contract BoringVaultAdapter is function balanceOf( address account ) public view override(IERC20, ERC20Upgradeable) returns (uint256) { - BoringVaultAdapterStorage storage $ = _getBoringVaultAdapterStorage(); - return $.boringVault.lens.balanceOf(account, $.boringVault.vault); + return super.balanceOf(account); } /** @@ -460,8 +459,9 @@ abstract contract BoringVaultAdapter is function assetsOf( address account ) public view virtual override(ComponentToken) returns (uint256) { - BoringVaultAdapterStorage storage $ = _getBoringVaultAdapterStorage(); - return $.boringVault.lens.balanceOfInAssets(account, $.boringVault.vault, $.boringVault.accountant); + // Convert the user's shares to assets using the conversion rate + uint256 shares = super.balanceOf(account); + return convertToAssets(shares); } // ========== METADATA OVERRIDES ========== From e1ed7d47541c2b6124665e677e54c52bc13c087f Mon Sep 17 00:00:00 2001 From: ungaro Date: Mon, 9 Dec 2024 19:28:37 -0500 Subject: [PATCH 2/2] correct assetsOf function --- nest/src/token/BoringVaultAdapter.sol | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/nest/src/token/BoringVaultAdapter.sol b/nest/src/token/BoringVaultAdapter.sol index 34399c5..1bc4629 100644 --- a/nest/src/token/BoringVaultAdapter.sol +++ b/nest/src/token/BoringVaultAdapter.sol @@ -459,9 +459,7 @@ abstract contract BoringVaultAdapter is function assetsOf( address account ) public view virtual override(ComponentToken) returns (uint256) { - // Convert the user's shares to assets using the conversion rate - uint256 shares = super.balanceOf(account); - return convertToAssets(shares); + return super.assetsOf(account); } // ========== METADATA OVERRIDES ==========