Skip to content

Commit

Permalink
call with selected nodes
Browse files Browse the repository at this point in the history
  • Loading branch information
hpmaxi committed Feb 19, 2025
1 parent e96d838 commit 552e222
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions src/ynEIGEN/EigenStrategyManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -204,22 +204,19 @@ contract EigenStrategyManager is
}
}

function syncBalances() external {
ITokenStakingNode[] memory nodes = tokenStakingNodesManager.getAllNodes();
uint256 nodesCount = nodes.length;

for (uint256 i; i < nodesCount; i++ ) {
ITokenStakingNode node = nodes[i];
node.synchronize();
function synchronizeNodesAndUpdateBalances(ITokenStakingNode[] calldata nodes) external {
uint256 nodesLength = nodes.length;
for(uint256 i = 0; i < nodesLength; i++) {
nodes[i].synchronize();
}

IERC20[] memory assets = IynEigenVars(address(ynEigen)).assetRegistry().getAssets();
uint256 assetsLength = assets.length;
for (uint256 i = 0; i < assetsLength; i++) {
_updateTokenStakingNodesBalances(assets[i], IStrategy(address(0)));
}
}

//--------------------------------------------------------------------------------------
//------------------------------------ ACCOUNTING ----------------------------------------
//--------------------------------------------------------------------------------------
Expand All @@ -230,7 +227,7 @@ contract EigenStrategyManager is
/// @param asset The ERC20 token for which the balances are to be updated.
function updateTokenStakingNodesBalances(IERC20 asset) public {
_updateTokenStakingNodesBalances(asset, strategies[asset]);
}
}

/// @notice Updates the staked balances for all nodes for a strategies.
/// @dev Should be called atomically after any node-balance-changing operation.
Expand Down

0 comments on commit 552e222

Please sign in to comment.