Skip to content

Commit

Permalink
squash
Browse files Browse the repository at this point in the history
  • Loading branch information
gpsanant committed Sep 16, 2024
1 parent be15a8e commit d0a6339
Show file tree
Hide file tree
Showing 5 changed files with 361 additions and 718 deletions.
15 changes: 9 additions & 6 deletions script/deploy/devnet/operatorSets/PopulateSRC.sol
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,19 @@ contract PopulateSRC is Script, Test, ExistingDeploymentParser {
IStakeRootCompendium stakeRootCompendiumImplementation = new StakeRootCompendium({
_delegationManager: delegationManager,
_avsDirectory: avsDirectory,
_proofInterval: proofInterval,
_blacklistWindow: 12 seconds
_maxTotalCharge: 100 ether,
_minBalanceThreshold: 0 ether,
_minProofsDuration: 20,
_verifier: address(0),
_imageId: bytes32(0)
});
StakeRootCompendium stakeRootCompendium = StakeRootCompendium(payable(new TransparentUpgradeableProxy(
address(stakeRootCompendiumImplementation),
proxyAdmin,
"" // TODO: initialize
)));
IStakeRootCompendium.Proof memory proof;
stakeRootCompendium.verifyStakeRoot(uint32(block.timestamp - (block.timestamp % proofInterval)), bytes32(0), address(0), proof);
stakeRootCompendium.verifyStakeRoot(uint32(block.timestamp - (block.timestamp % proofInterval)), bytes32(0), address(0), 0, proof);
vm.stopBroadcast();

emit log_named_address("stakeRootCompendium", address(stakeRootCompendium));
Expand Down Expand Up @@ -76,7 +79,7 @@ contract PopulateSRC is Script, Test, ExistingDeploymentParser {
uint64 magnitudeForOperators = 0.1 ether;
vm.startBroadcast();
AVS avs = new AVS(avsDirectory, stakeRootCompendium);
payable(address(avs)).transfer(2 * stakeRootCompendium.MIN_DEPOSIT_BALANCE() * strategies.length);
payable(address(avs)).transfer(2 * stakeRootCompendium.MIN_BALANCE_THRESHOLD() * strategies.length);

for (uint i = 0; i < strategies.length; i++) {
avs.createOperatorSetAndRegisterOperators(uint32(i), strategies[i], operators[i]);
Expand Down Expand Up @@ -132,7 +135,7 @@ contract AVS {
if(!avsDirectory.isOperatorSet(address(this), operatorSetId)) {
avsDirectory.createOperatorSets(operatorSetIdsToCreate);

stakeRootCompendium.depositForOperatorSet{value: 2 * stakeRootCompendium.MIN_DEPOSIT_BALANCE()}(IAVSDirectory.OperatorSet({
stakeRootCompendium.deposit{value: 2 * stakeRootCompendium.MIN_BALANCE_THRESHOLD()}(IAVSDirectory.OperatorSet({
avs: address(this),
operatorSetId: operatorSetId
}));
Expand All @@ -159,7 +162,7 @@ contract AVS {
multiplier: 1 ether
});
}
stakeRootCompendium.addStrategiesAndMultipliers(operatorSetId, strategiesAndMultipliers);
stakeRootCompendium.addOrModifyStrategiesAndMultipliers(operatorSetId, strategiesAndMultipliers);
stakeRootCompendium.setOperatorSetExtraData(operatorSetId, keccak256(abi.encodePacked(operatorSetId)));
for (uint256 i = 0; i < operators.length; ++i) {
stakeRootCompendium.setOperatorExtraData(operatorSetId, operators[i], keccak256(abi.encodePacked(operators[i])));
Expand Down
267 changes: 0 additions & 267 deletions script/deploy/devnet/operatorSets/PopulateSRC2.sol

This file was deleted.

Loading

0 comments on commit d0a6339

Please sign in to comment.