Skip to content

Commit

Permalink
Fix audit issue 8.9
Browse files Browse the repository at this point in the history
  • Loading branch information
xhad committed Mar 29, 2024
1 parent ced5c5f commit aef66d1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/ynLSD.sol
Original file line number Diff line number Diff line change
Expand Up @@ -355,14 +355,15 @@ contract ynLSD is IynLSD, ynBase, ReentrancyGuardUpgradeable, IynLSDEvents {
onlyRole(LSD_STAKING_NODE_CREATOR_ROLE)
returns (ILSDStakingNode) {

if (nodes.length >= maxNodeCount) {
uint256 nodeId = nodes.length;

if (nodeId >= maxNodeCount) {
revert TooManyStakingNodes(maxNodeCount);
}

BeaconProxy proxy = new BeaconProxy(address(upgradeableBeacon), "");
ILSDStakingNode node = ILSDStakingNode(payable(proxy));

uint256 nodeId = nodes.length;
initializeLSDStakingNode(node);

nodes.push(node);
Expand Down

0 comments on commit aef66d1

Please sign in to comment.