Skip to content

Commit

Permalink
populatesrc works
Browse files Browse the repository at this point in the history
  • Loading branch information
gpsanant authored and ypatil12 committed Sep 24, 2024
1 parent fe917de commit d8a5ff8
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 13 deletions.
6 changes: 3 additions & 3 deletions script/deploy/devnet/operatorSets/PopulateSRC.sol
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ contract PopulateSRC is Script, Test, ExistingDeploymentParser {
msg.sender,
uint32(1 minutes),
IStakeRootCompendium.ChargeParams({
chargePerOperatorSet: uint96(100 ether),
chargePerOperatorSet: uint96(0),
chargePerStrategy: uint96(0),
maxChargePerProof: uint96(0)
maxChargePerProof: uint96(100 ether)
})
)
)));
Expand Down Expand Up @@ -251,7 +251,7 @@ contract Operator is IERC1271 {
});
delegationManager.registerAsOperator(
operatorDetails,
0,
1,
""
);
}
Expand Down
21 changes: 11 additions & 10 deletions src/contracts/core/DelegationManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -906,21 +906,22 @@ contract DelegationManager is
// Get a list of all the strategies to check
IStrategy[] memory strategies = strategyManager.getStakerStrategyList(staker);
// resize and add beaconChainETH to the end
assembly {
mstore(strategies, add(mload(strategies), 1))
IStrategy[] memory strategiesWithBeaconChainETH = new IStrategy[](strategies.length + 1);
for (uint256 i = 0; i < strategies.length; i++) {
strategiesWithBeaconChainETH[i] = strategies[i];
}
strategies[strategies.length - 1] = beaconChainETHStrategy;
strategiesWithBeaconChainETH[strategies.length] = beaconChainETHStrategy;

// get the delegatable shares for each strategy
uint256[] memory shares = getDelegatableShares(staker, strategies);
// if the last shares are 0, remove them
if (shares[strategies.length - 1] == 0) {
// resize the arrays
assembly {
mstore(strategies, sub(mload(strategies), 1))
mstore(shares, sub(mload(shares), 1))
}
}
// if (shares[strategies.length - 1] == 0) {
// // resize the arrays
// assembly {
// mstore(strategies, sub(mload(strategies), 1))
// mstore(shares, sub(mload(shares), 1))
// }
// }

return (strategies, shares);
}
Expand Down

0 comments on commit d8a5ff8

Please sign in to comment.