Skip to content

Commit

Permalink
change balanceof and assetsOf functions - WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
ungaro committed Dec 9, 2024
1 parent 663410a commit 6322211
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions nest/src/token/BoringVaultAdapter.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

/**
Expand All @@ -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 ==========
Expand Down

0 comments on commit 6322211

Please sign in to comment.