Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
johnnyonline committed Oct 15, 2024
1 parent 7412dff commit d44da58
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 13 deletions.
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,3 @@
path = lib/eigenlayer-contracts
url = https://github.com/layr-labs/eigenlayer-contracts
commit = bda003385c5fec59e35196dc14d01f17d1eb7001
[submodule "lib/solady"]
path = lib/solady
url = https://github.com/Vectorized/solady
1 change: 0 additions & 1 deletion lib/solady
Submodule solady deleted from e0ef35
12 changes: 3 additions & 9 deletions src/ynEIGEN/EigenStrategyManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
pragma solidity ^0.8.24;

import {SafeCast} from "lib/openzeppelin-contracts/contracts/utils/math/SafeCast.sol";
import {DynamicArrayLib} from "lib/solady/src/utils/DynamicArrayLib.sol";
import {Initializable} from "lib/openzeppelin-contracts-upgradeable/contracts/proxy/utils/Initializable.sol";
import {AccessControlUpgradeable} from "lib/openzeppelin-contracts-upgradeable/contracts/access/AccessControlUpgradeable.sol";
import {ReentrancyGuardUpgradeable} from "lib/openzeppelin-contracts-upgradeable/contracts/utils/ReentrancyGuardUpgradeable.sol";
Expand Down Expand Up @@ -417,22 +416,17 @@ contract EigenStrategyManager is
* @param assets An array of ERC20 tokens for which balances are to be retrieved.
* @return stakedBalances An array of total balances for each asset, indexed in the same order as the `assets` array.
*/
function getStakedAssetsBalances(IERC20[] calldata assets) public view returns (uint256[] memory) {
function getStakedAssetsBalances(IERC20[] calldata assets) public view returns (uint256[] memory stakedBalances) {

uint256[] memory stakedBalances = DynamicArrayLib.malloc(assets.length);
stakedBalances = new uint256[](assets.length);
// Add balances contained in each TokenStakingNode, including those managed by strategies.

uint256 assetsCount = assets.length;
for (uint256 j = 0; j < assetsCount; j++) {
IERC20 asset = assets[j];
IStrategy strategy = strategies[asset];
StrategyBalance memory balance = strategiesBalance[strategy];
DynamicArrayLib.set(
stakedBalances,
j,
wrapper.toUserAssetAmount(asset, balance.stakedBalance)
+ balance.withdrawnBalance
);
stakedBalances[j] = wrapper.toUserAssetAmount(asset, balance.stakedBalance) + balance.withdrawnBalance;
}

return stakedBalances;
Expand Down

0 comments on commit d44da58

Please sign in to comment.